aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/stage1/behavior/pointers.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/stage1/behavior/pointers.zig b/test/stage1/behavior/pointers.zig
index fa5f2a469d..a4f619b538 100644
--- a/test/stage1/behavior/pointers.zig
+++ b/test/stage1/behavior/pointers.zig
@@ -1,6 +1,7 @@
const std = @import("std");
-const expect = std.testing.expect;
-const expectError = std.testing.expectError;
+const testing = std.testing;
+const expect = testing.expect;
+const expectError = testing.expectError;
test "dereference pointer" {
comptime testDerefPtr();
@@ -331,3 +332,8 @@ test "@ptrToInt on null optional at comptime" {
comptime expect(0xf00 == @ptrToInt(pointer));
}
}
+
+test "indexing array with sentinel returns correct type" {
+ var s: [:0]const u8 = "abc";
+ testing.expectEqualSlices(u8, "*const u8", @typeName(@TypeOf(&s[0])));
+}