summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:48:48 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:48:48 +0200
commit19904ba49a03a450e8a573358eb3417a3aafdb1f (patch)
tree6a9913234c77586483ac68fc501be8784ae357d0 /tests
parent23e121d2f74ad2dd1ab0902f120aa90bee2c7edb (diff)
Install sampled eager hooks
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 4d512be..7947ab1 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -6899,6 +6899,36 @@ test("Explicit motion execution bypasses primary feedback operations", function(
same(0, refresh_count)
end)
+test("Activation installs eager hooks from sampled setup policy", function()
+ fresh_sequence_state()
+ local enabled_host = MemoryHost.new({
+ configuration = { clean_labels_eagerly = true },
+ })
+ local enabled = feedback_service.new(enabled_host)
+ local activation = enabled:activate()
+ truthy(activation.clean_labels_eagerly)
+ truthy(activation.eager_registration ~= nil)
+ local registration = enabled_host:event_registrations()[
+ activation.eager_registration
+ ]
+ list_same(feedback_service.EAGER_EVENTS, registration.names)
+ same("eager", registration.options.lifecycle)
+
+ enabled_host:set_configuration("clean_labels_eagerly", false)
+ local retained = enabled:activate()
+ same(activation.eager_registration, retained.eager_registration)
+ truthy(retained.clean_labels_eagerly)
+
+ fresh_sequence_state()
+ local disabled_host = MemoryHost.new({
+ configuration = { clean_labels_eagerly = false },
+ })
+ local disabled = feedback_service.new(disabled_host):activate()
+ falsy(disabled.clean_labels_eagerly)
+ same(nil, disabled.eager_registration)
+ same(0, map_size(disabled_host:event_registrations()))
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then