Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
Add empty iteration tests
src/view_stack.zig | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/view_stack.zig b/src/view_stack.zig
index d544f32..a8ec530 100644
--- a/src/view_stack.zig
+++ b/src/view_stack.zig
@@ -337,6 +337,12 @@ test "iteration" {
testing.expect(it.next() == null);
}
+ // Iteration over tags that aren't present
+ {
+ var it = ViewStack.iterator(views.first, 1 << 2);
+ testing.expect(it.next() == null);
+ }
+
// Reverse iteration over all tags
{
var it = ViewStack.reverseIterator(views.last, 0xFFFFFFFF);
@@ -365,6 +371,12 @@ test "iteration" {
testing.expect(it.next() == null);
}
+ // Reverse iteration over tags that aren't present
+ {
+ var it = ViewStack.reverseIterator(views.first, 1 << 2);
+ testing.expect(it.next() == null);
+ }
+
// Iteration over (pending) 'a' tags
{
var it = ViewStack.pendingIterator(views.first, 1 << 0);
@@ -381,4 +393,10 @@ test "iteration" {
testing.expect(it.next() == &one_a_pb.view);
testing.expect(it.next() == null);
}
+
+ // Iteration over (pending) tags that aren't present
+ {
+ var it = ViewStack.pendingIterator(views.first, 1 << 2);
+ testing.expect(it.next() == null);
+ }
}