module: update tests for sendGlobal changes

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-03-26 09:12:59 -07:00 committed by Stephen Gutekanst
parent 23b03f973f
commit f50a27b83d

View file

@ -992,7 +992,7 @@ test "dispatch" {
// global event handler declaration within a module. It is required that all global event handlers // global event handler declaration within a module. It is required that all global event handlers
// of the same name have the same standard arguments, although they can start with different // of the same name have the same standard arguments, although they can start with different
// injected arguments. // injected arguments.
modules.sendGlobal(.tick, .{}); modules.sendGlobal(.engine_renderer, .tick, .{});
try testing.expect(usize, 0).eql(global.ticks); try testing.expect(usize, 0).eql(global.ticks);
try modules.dispatch(.{&foo}); try modules.dispatch(.{&foo});
try testing.expect(usize, 2).eql(global.ticks); try testing.expect(usize, 2).eql(global.ticks);
@ -1004,7 +1004,7 @@ test "dispatch" {
// Global events which are not handled by anyone yet can be written as `pub const fooBar = fn() void;` // Global events which are not handled by anyone yet can be written as `pub const fooBar = fn() void;`
// within a module, which allows pre-declaring that `fooBar` is a valid global event, and enables // within a module, which allows pre-declaring that `fooBar` is a valid global event, and enables
// its arguments to be inferred still like this: // its arguments to be inferred still like this:
modules.sendGlobal(.frame_done, .{ .@"0" = 1337 }); modules.sendGlobal(.engine_renderer, .frame_done, .{ .@"0" = 1337 });
// Local events // Local events
modules.sendToModule(.engine_renderer, .update, .{}); modules.sendToModule(.engine_renderer, .update, .{});