| author | |
| committer | |
| log | 85869f8225dc3f2d21fe540559e05fd1fa94d5ed |
| tree | a5361265787cff9414bd7aea5e5d75d0b9060b47 |
| parent | d7b36503cad1de60cd0b6a115ef7ac336a03a09a |
4 files changed, 19 insertions(+), 19 deletions(-)
lib/std/mem.zig+3-3| ... | ... | @@ -3284,9 +3284,9 @@ pub fn indexOfMinMax(comptime T: type, slice: []const T) IndexOfMinMaxResult { |
| 3284 | 3284 | pub const IndexOfMinMaxResult = struct { index_min: usize, index_max: usize }; |
| 3285 | 3285 | |
| 3286 | 3286 | test "indexOfMinMax" { |
| 3287 | try testing.expectEqual(indexOfMinMax(u8, "abcdefg"), IndexOfMinMaxResult{ .index_min = 0, .index_max = 6 }); | |
| 3288 | try testing.expectEqual(indexOfMinMax(u8, "gabcdef"), IndexOfMinMaxResult{ .index_min = 1, .index_max = 0 }); | |
| 3289 | try testing.expectEqual(indexOfMinMax(u8, "a"), IndexOfMinMaxResult{ .index_min = 0, .index_max = 0 }); | |
| 3287 | try testing.expectEqual(IndexOfMinMaxResult{ .index_min = 0, .index_max = 6 }, indexOfMinMax(u8, "abcdefg")); | |
| 3288 | try testing.expectEqual(IndexOfMinMaxResult{ .index_min = 1, .index_max = 0 }, indexOfMinMax(u8, "gabcdef")); | |
| 3289 | try testing.expectEqual(IndexOfMinMaxResult{ .index_min = 0, .index_max = 0 }, indexOfMinMax(u8, "a")); | |
| 3290 | 3290 | } |
| 3291 | 3291 | |
| 3292 | 3292 | pub fn swap(comptime T: type, a: *T, b: *T) void { |
lib/std/multi_array_list.zig+12-12| ... | ... | @@ -842,24 +842,24 @@ test "union" { |
| 842 | 842 | &.{ .a, .b, .b, .a, .a, .a, .a, .a, .a }, |
| 843 | 843 | list.items(.tags), |
| 844 | 844 | ); |
| 845 | try testing.expectEqual(list.get(0), Foo{ .a = 1 }); | |
| 846 | try testing.expectEqual(list.get(1), Foo{ .b = "zigzag" }); | |
| 847 | try testing.expectEqual(list.get(2), Foo{ .b = "foobar" }); | |
| 848 | try testing.expectEqual(list.get(3), Foo{ .a = 4 }); | |
| 849 | try testing.expectEqual(list.get(4), Foo{ .a = 5 }); | |
| 850 | try testing.expectEqual(list.get(5), Foo{ .a = 6 }); | |
| 851 | try testing.expectEqual(list.get(6), Foo{ .a = 7 }); | |
| 852 | try testing.expectEqual(list.get(7), Foo{ .a = 8 }); | |
| 853 | try testing.expectEqual(list.get(8), Foo{ .a = 9 }); | |
| 845 | try testing.expectEqual(Foo{ .a = 1 }, list.get(0)); | |
| 846 | try testing.expectEqual(Foo{ .b = "zigzag" }, list.get(1)); | |
| 847 | try testing.expectEqual(Foo{ .b = "foobar" }, list.get(2)); | |
| 848 | try testing.expectEqual(Foo{ .a = 4 }, list.get(3)); | |
| 849 | try testing.expectEqual(Foo{ .a = 5 }, list.get(4)); | |
| 850 | try testing.expectEqual(Foo{ .a = 6 }, list.get(5)); | |
| 851 | try testing.expectEqual(Foo{ .a = 7 }, list.get(6)); | |
| 852 | try testing.expectEqual(Foo{ .a = 8 }, list.get(7)); | |
| 853 | try testing.expectEqual(Foo{ .a = 9 }, list.get(8)); | |
| 854 | 854 | |
| 855 | 855 | list.shrinkAndFree(ally, 3); |
| 856 | 856 | |
| 857 | 857 | try testing.expectEqual(@as(usize, 3), list.items(.tags).len); |
| 858 | 858 | try testing.expectEqualSlices(meta.Tag(Foo), list.items(.tags), &.{ .a, .b, .b }); |
| 859 | 859 | |
| 860 | try testing.expectEqual(list.get(0), Foo{ .a = 1 }); | |
| 861 | try testing.expectEqual(list.get(1), Foo{ .b = "zigzag" }); | |
| 862 | try testing.expectEqual(list.get(2), Foo{ .b = "foobar" }); | |
| 860 | try testing.expectEqual(Foo{ .a = 1 }, list.get(0)); | |
| 861 | try testing.expectEqual(Foo{ .b = "zigzag" }, list.get(1)); | |
| 862 | try testing.expectEqual(Foo{ .b = "foobar" }, list.get(2)); | |
| 863 | 863 | } |
| 864 | 864 | |
| 865 | 865 | test "sorting a span" { |
test/behavior/cast.zig+1-1| ... | ... | @@ -1156,7 +1156,7 @@ test "cast function with an opaque parameter" { |
| 1156 | 1156 | .func = @ptrCast(&Foo.funcImpl), |
| 1157 | 1157 | }; |
| 1158 | 1158 | c.func(c.ctx); |
| 1159 | try std.testing.expectEqual(foo, Foo{ .x = 101, .y = 201 }); | |
| 1159 | try std.testing.expectEqual(Foo{ .x = 101, .y = 201 }, foo); | |
| 1160 | 1160 | } |
| 1161 | 1161 | |
| 1162 | 1162 | test "implicit ptr to *anyopaque" { |
test/c_abi/main.zig+3-3| ... | ... | @@ -946,7 +946,7 @@ test "DC: C returns to Zig" { |
| 946 | 946 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; |
| 947 | 947 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 948 | 948 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 949 | try expectEqual(c_ret_DC(), DC{ .v1 = -0.25, .v2 = 15 }); | |
| 949 | try expectEqual(DC{ .v1 = -0.25, .v2 = 15 }, c_ret_DC()); | |
| 950 | 950 | } |
| 951 | 951 | |
| 952 | 952 | pub extern fn c_assert_DC(lv: DC) c_int; |
| ... | ... | @@ -998,7 +998,7 @@ test "CFF: C returns to Zig" { |
| 998 | 998 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 999 | 999 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 1000 | 1000 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 1001 | try expectEqual(c_ret_CFF(), CFF{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }); | |
| 1001 | try expectEqual(CFF{ .v1 = 39, .v2 = 0.875, .v3 = 1.0 }, c_ret_CFF()); | |
| 1002 | 1002 | } |
| 1003 | 1003 | pub extern fn c_assert_CFF(lv: CFF) c_int; |
| 1004 | 1004 | pub extern fn c_assert_ret_CFF() c_int; |
| ... | ... | @@ -1045,7 +1045,7 @@ test "PD: C returns to Zig" { |
| 1045 | 1045 | if (comptime builtin.cpu.arch.isMIPS() and builtin.mode != .Debug) return error.SkipZigTest; |
| 1046 | 1046 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 1047 | 1047 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 1048 | try expectEqual(c_ret_PD(), PD{ .v1 = null, .v2 = 0.5 }); | |
| 1048 | try expectEqual(PD{ .v1 = null, .v2 = 0.5 }, c_ret_PD()); | |
| 1049 | 1049 | } |
| 1050 | 1050 | pub extern fn c_assert_PD(lv: PD) c_int; |
| 1051 | 1051 | pub extern fn c_assert_ret_PD() c_int; |