aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compile_errors.zig18
-rw-r--r--test/stage1/behavior/type.zig4
2 files changed, 9 insertions, 13 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 1438a59539..38fca5754d 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -2,6 +2,15 @@ const tests = @import("tests.zig");
const builtin = @import("builtin");
pub fn addCases(cases: *tests.CompileErrorContext) void {
+ cases.add(
+ "attempt to create 17 bit float type",
+ \\const builtin = @import("builtin");
+ \\comptime {
+ \\ _ = @Type(builtin.TypeInfo { .Float = builtin.TypeInfo.Float { .bits = 17 } });
+ \\}
+ ,
+ "tmp.zig:3:32: error: 17-bit float unsupported",
+ );
cases.add(
"wrong type for @Type",
@@ -46,15 +55,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
);
cases.add(
- "array not implemented for @Type",
- \\export fn entry() void {
- \\ _ = @Type(@typeInfo(enum{x}));
- \\}
- ,
- "tmp.zig:2:15: error: TODO implement @Type forr 'TypeInfo.Enum': see https://github.com/ziglang/zig/issues/2907",
- );
-
- cases.add(
"wrong type for result ptr to @asyncCall",
\\export fn entry() void {
\\ _ = async amain();
diff --git a/test/stage1/behavior/type.zig b/test/stage1/behavior/type.zig
index 318e07fbdf..5b2998f088 100644
--- a/test/stage1/behavior/type.zig
+++ b/test/stage1/behavior/type.zig
@@ -38,8 +38,6 @@ test "Type.Int" {
testing.expect(u64 == @Type(TypeInfo { .Int = TypeInfo.Int { .is_signed = false, .bits = 64 } }));
testing.expect(i64 == @Type(TypeInfo { .Int = TypeInfo.Int { .is_signed = true, .bits = 64 } }));
testTypes([_]type {u8,u32,i64});
- // TODO: should this work?
- //testing.expect(u1 == @Type(TypeInfo.Int { .is_signed = false, .bits = 1 } ));
}
test "Type.Float" {
@@ -48,8 +46,6 @@ test "Type.Float" {
testing.expect(f64 == @Type(TypeInfo { .Float = TypeInfo.Float { .bits = 64 } }));
testing.expect(f128 == @Type(TypeInfo { .Float = TypeInfo.Float { .bits = 128 } }));
testTypes([_]type {f16, f32, f64, f128});
- // error: 17-bit float unsupported
- //testing.expect(f16 == @Type(TypeInfo { .Float = TypeInfo.Float { .bits = 17 } }));
}
test "Type.Pointer" {