diff options
| author | Matthew McAllister <matthew.mcallister.0@gmail.com> | 2019-02-17 12:47:53 -0800 |
|---|---|---|
| committer | Matthew McAllister <matthew.mcallister.0@gmail.com> | 2019-02-17 15:33:28 -0800 |
| commit | c70ee9177e5b0095c152b66fe8f22cd870e778b9 (patch) | |
| tree | a3f538f14b0c597422398d595d02053bf3698315 /test/compile_errors.zig | |
| parent | 51783510b9b972fab52d429ff3311b0fe8402e42 (diff) | |
| download | zig-c70ee9177e5b0095c152b66fe8f22cd870e778b9.tar.gz zig-c70ee9177e5b0095c152b66fe8f22cd870e778b9.zip | |
Check for duped error messages in compile tests
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 7953eda2ab..a18884cc9a 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -137,19 +137,23 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { ".tmp_source.zig:3:15: error: C pointers cannot point to non-C-ABI-compatible type 'Foo'", ); - cases.addTest( - "compile log statement warning deduplication in generic fn", - \\export fn entry() void { - \\ inner(1); - \\ inner(2); - \\} - \\fn inner(comptime n: usize) void { - \\ comptime var i = 0; - \\ inline while (i < n) : (i += 1) { @compileLog("!@#$"); } - \\} - , - ".tmp_source.zig:7:39: error: found compile log statement", - ); + cases.addCase(x: { + var tc = cases.create( + "compile log statement warning deduplication in generic fn", + \\export fn entry() void { + \\ inner(1); + \\ inner(2); + \\} + \\fn inner(comptime n: usize) void { + \\ comptime var i = 0; + \\ inline while (i < n) : (i += 1) { @compileLog("!@#$"); } + \\} + , + ".tmp_source.zig:7:39: error: found compile log statement", + ); + tc.expect_exact = true; + break :x tc; + }); cases.addTest( "@truncate undefined value", |
