aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorMatthew McAllister <matthew.mcallister.0@gmail.com>2019-02-17 12:47:53 -0800
committerMatthew McAllister <matthew.mcallister.0@gmail.com>2019-02-17 15:33:28 -0800
commitc70ee9177e5b0095c152b66fe8f22cd870e778b9 (patch)
treea3f538f14b0c597422398d595d02053bf3698315 /test/compile_errors.zig
parent51783510b9b972fab52d429ff3311b0fe8402e42 (diff)
downloadzig-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.zig30
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",