Correct expected/actual parameter order of some assertions

This commit is contained in:
Carl Åstholm
2024-01-01 17:37:32 +01:00
parent d7b36503ca
commit 85869f8225
4 changed files with 19 additions and 19 deletions

View File

@@ -842,24 +842,24 @@ test "union" {
&.{ .a, .b, .b, .a, .a, .a, .a, .a, .a },
list.items(.tags),
);
try testing.expectEqual(list.get(0), Foo{ .a = 1 });
try testing.expectEqual(list.get(1), Foo{ .b = "zigzag" });
try testing.expectEqual(list.get(2), Foo{ .b = "foobar" });
try testing.expectEqual(list.get(3), Foo{ .a = 4 });
try testing.expectEqual(list.get(4), Foo{ .a = 5 });
try testing.expectEqual(list.get(5), Foo{ .a = 6 });
try testing.expectEqual(list.get(6), Foo{ .a = 7 });
try testing.expectEqual(list.get(7), Foo{ .a = 8 });
try testing.expectEqual(list.get(8), Foo{ .a = 9 });
try testing.expectEqual(Foo{ .a = 1 }, list.get(0));
try testing.expectEqual(Foo{ .b = "zigzag" }, list.get(1));
try testing.expectEqual(Foo{ .b = "foobar" }, list.get(2));
try testing.expectEqual(Foo{ .a = 4 }, list.get(3));
try testing.expectEqual(Foo{ .a = 5 }, list.get(4));
try testing.expectEqual(Foo{ .a = 6 }, list.get(5));
try testing.expectEqual(Foo{ .a = 7 }, list.get(6));
try testing.expectEqual(Foo{ .a = 8 }, list.get(7));
try testing.expectEqual(Foo{ .a = 9 }, list.get(8));
list.shrinkAndFree(ally, 3);
try testing.expectEqual(@as(usize, 3), list.items(.tags).len);
try testing.expectEqualSlices(meta.Tag(Foo), list.items(.tags), &.{ .a, .b, .b });
try testing.expectEqual(list.get(0), Foo{ .a = 1 });
try testing.expectEqual(list.get(1), Foo{ .b = "zigzag" });
try testing.expectEqual(list.get(2), Foo{ .b = "foobar" });
try testing.expectEqual(Foo{ .a = 1 }, list.get(0));
try testing.expectEqual(Foo{ .b = "zigzag" }, list.get(1));
try testing.expectEqual(Foo{ .b = "foobar" }, list.get(2));
}
test "sorting a span" {