aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-01-15 22:59:33 -0800
committerGitHub <noreply@github.com>2024-01-15 22:59:33 -0800
commitca8c6dd4d65abaadaf0633f4a72e5c0ed79b3c53 (patch)
treefdc360285a385f966f16fb5530d6e8a5e3fda58f /test/behavior/basic.zig
parentfcc94f54317f12fadffb7822cb4478f49e4045a1 (diff)
parenta219c9faaa7622910d3472853ab648581174aeb4 (diff)
downloadzig-ca8c6dd4d65abaadaf0633f4a72e5c0ed79b3c53.tar.gz
zig-ca8c6dd4d65abaadaf0633f4a72e5c0ed79b3c53.zip
Merge pull request #18569 from dweiller/17944-followup
17944 followup
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index 32afd06e02..dc04a5b45c 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -17,7 +17,7 @@ test "empty function with comments" {
test "truncate" {
try expect(testTruncate(0x10fd) == 0xfd);
- try comptime expect(testTruncate(0x10fd) == 0xfd);
+ comptime assert(testTruncate(0x10fd) == 0xfd);
}
fn testTruncate(x: u32) u8 {
return @as(u8, @truncate(x));
@@ -568,7 +568,7 @@ fn emptyFn() void {}
const addr1 = @as(*const u8, @ptrCast(&emptyFn));
test "comptime cast fn to ptr" {
const addr2 = @as(*const u8, @ptrCast(&emptyFn));
- try comptime expect(addr1 == addr2);
+ comptime assert(addr1 == addr2);
}
test "equality compare fn ptrs" {
@@ -678,8 +678,8 @@ test "string concatenation" {
const a = "OK" ++ " IT " ++ "WORKED";
const b = "OK IT WORKED";
- try comptime expect(@TypeOf(a) == *const [12:0]u8);
- try comptime expect(@TypeOf(b) == *const [12:0]u8);
+ comptime assert(@TypeOf(a) == *const [12:0]u8);
+ comptime assert(@TypeOf(b) == *const [12:0]u8);
const len = b.len;
const len_with_null = len + 1;
@@ -747,7 +747,7 @@ test "auto created variables have correct alignment" {
}
};
try expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a);
- try comptime expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a);
+ comptime assert(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a);
}
test "extern variable with non-pointer opaque type" {