Commit b1895da9b8

Andrew Kelley <andrew@ziglang.org>
2019-12-06 18:27:56
add behavioral test case for previous commit
1 parent f64cff3
Changed files (1)
test
stage1
behavior
test/stage1/behavior/type.zig
@@ -130,3 +130,17 @@ test "Type.Undefined" {
 test "Type.Null" {
     testTypes(&[_]type{@typeOf(null)});
 }
+test "@Type create slice with null sentinel" {
+    const Slice = @Type(builtin.TypeInfo{
+        .Pointer = .{
+            .size = .Slice,
+            .is_const = true,
+            .is_volatile = false,
+            .is_allowzero = false,
+            .alignment = 8,
+            .child = *i32,
+            .sentinel = null,
+        },
+    });
+    testing.expect(Slice == []align(8) const *i32);
+}