diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-01-15 22:59:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-15 22:59:33 -0800 |
| commit | ca8c6dd4d65abaadaf0633f4a72e5c0ed79b3c53 (patch) | |
| tree | fdc360285a385f966f16fb5530d6e8a5e3fda58f /test/behavior/array.zig | |
| parent | fcc94f54317f12fadffb7822cb4478f49e4045a1 (diff) | |
| parent | a219c9faaa7622910d3472853ab648581174aeb4 (diff) | |
| download | zig-ca8c6dd4d65abaadaf0633f4a72e5c0ed79b3c53.tar.gz zig-ca8c6dd4d65abaadaf0633f4a72e5c0ed79b3c53.zip | |
Merge pull request #18569 from dweiller/17944-followup
17944 followup
Diffstat (limited to 'test/behavior/array.zig')
| -rw-r--r-- | test/behavior/array.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/behavior/array.zig b/test/behavior/array.zig index 8204453de6..75141c6bd1 100644 --- a/test/behavior/array.zig +++ b/test/behavior/array.zig @@ -2,6 +2,7 @@ const std = @import("std"); const builtin = @import("builtin"); const testing = std.testing; const mem = std.mem; +const assert = std.debug.assert; const expect = testing.expect; const expectEqual = testing.expectEqual; @@ -149,9 +150,9 @@ test "array len field" { var arr = [4]u8{ 0, 0, 0, 0 }; const ptr = &arr; try expect(arr.len == 4); - try comptime expect(arr.len == 4); + comptime assert(arr.len == 4); try expect(ptr.len == 4); - try comptime expect(ptr.len == 4); + comptime assert(ptr.len == 4); try expect(@TypeOf(arr.len) == usize); } @@ -904,7 +905,7 @@ test "store array of array of structs at comptime" { }; try expect(S.storeArrayOfArrayOfStructs() == 15); - try comptime expect(S.storeArrayOfArrayOfStructs() == 15); + comptime assert(S.storeArrayOfArrayOfStructs() == 15); } test "accessing multidimensional global array at comptime" { |
