diff options
Diffstat (limited to 'src/lua_event_bridge.zig')
| -rw-r--r-- | src/lua_event_bridge.zig | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lua_event_bridge.zig b/src/lua_event_bridge.zig index f6d67e0..c4acb1d 100644 --- a/src/lua_event_bridge.zig +++ b/src/lua_event_bridge.zig @@ -797,9 +797,11 @@ test "Lua-defined component renders lines through the bridged vtable" { try testing.expectEqual(@as(usize, 2), lines.len); try testing.expectEqualStrings("hello", lines[0]); try testing.expectEqualStrings("world", lines[1]); - // firstLineChanged is cache-derived: first render dirties from 0. - try testing.expectEqual(@as(?usize, 0), chosen.?.firstLineChanged()); - // A second identical render reports no change. + // firstLineChanged is cache-derived and is the LIVE signal: after a render + // the cache is clean, so it reports null (the first-render diff index 0 is + // retained internally as bookkeeping only). + try testing.expectEqual(@as(?usize, null), chosen.?.firstLineChanged()); + // A second identical render still reports no change. _ = try chosen.?.render(80, testing.allocator); try testing.expectEqual(@as(?usize, null), chosen.?.firstLineChanged()); } @@ -1258,10 +1260,11 @@ test "bridged firstLineChanged is cache-derived: append stays near the tail" { try bridge.attachBus(&bus); const chosen = bus.fire("tool", null, .{ .tool = .{} }).?; - // First render: 2 lines, dirty from 0. + // First render: 2 lines. After the render the cache is clean, so the live + // signal is null (the first-render diff index 0 is internal bookkeeping). _ = try chosen.render(80, testing.allocator); - try testing.expectEqual(@as(?usize, 0), chosen.firstLineChanged()); - // No change: null. + try testing.expectEqual(@as(?usize, null), chosen.firstLineChanged()); + // No change: still null. _ = try chosen.render(80, testing.allocator); try testing.expectEqual(@as(?usize, null), chosen.firstLineChanged()); |
