| ... | @@ -2,6 +2,18 @@ const tests = @import("tests.zig"); | ... | @@ -2,6 +2,18 @@ const tests = @import("tests.zig"); |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | | 3 | |
| 4 | pub fn addCases(cases: *tests.CompileErrorContext) void { | 4 | pub fn addCases(cases: *tests.CompileErrorContext) void { |
| | 5 | cases.add("invalid float literal", |
| | 6 | \\const std = @import("std"); |
| | 7 | \\ |
| | 8 | \\pub fn main() void { |
| | 9 | \\ var bad_float :f32 = 0.0; |
| | 10 | \\ bad_float = bad_float + .20; |
| | 11 | \\ std.debug.assert(bad_float < 1.0); |
| | 12 | \\}) |
| | 13 | , &[_][]const u8{ |
| | 14 | "tmp.zig:5:29: error: invalid token: '.'", |
| | 15 | }); |
| | 16 | |
| 5 | cases.add("var args without c calling conv", | 17 | cases.add("var args without c calling conv", |
| 6 | \\fn foo(args: ...) void {} | 18 | \\fn foo(args: ...) void {} |
| 7 | \\comptime { | 19 | \\comptime { |