aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2015-12-24 13:19:31 -0700
committerAndrew Kelley <superjoe30@gmail.com>2015-12-24 13:19:31 -0700
commit4e52281142c80230e1c60ece2824656dd08afcbd (patch)
treeb1a3489dd47666d4fb21f00d30aedf250e451267 /test/run_tests.cpp
parent50357dad453845a69efff53370438dc29585dd17 (diff)
downloadzig-4e52281142c80230e1c60ece2824656dd08afcbd.tar.gz
zig-4e52281142c80230e1c60ece2824656dd08afcbd.zip
add test for error for redefinition of struct
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index bc04d3adcd..e2642d5128 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -867,6 +867,11 @@ fn f() {
)SOURCE", 2,
".tmp_source.zig:5:6: error: no member named 'foo' in 'A'",
".tmp_source.zig:6:16: error: no member named 'bar' in 'A'");
+
+ add_compile_fail_case("redefinition of struct", R"SOURCE(
+struct A { x : i32, }
+struct A { y : i32, }
+ )SOURCE", 1, ".tmp_source.zig:3:1: error: redefinition of 'A'");
}
static void print_compiler_invocation(TestCase *test_case) {