aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 130b99fd65..0fc63ee81f 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -999,11 +999,17 @@ extern fn foo() -> i32;
const x = foo();
)SOURCE", 1, ".tmp_source.zig:3:11: error: global variable initializer requires constant expression");
- add_compile_fail_case("non compile time string concatenation", R"SOURCE(
+ add_compile_fail_case("array concatenation with wrong type", R"SOURCE(
fn f(s: []u8) -> []u8 {
s ++ "foo"
}
- )SOURCE", 1, ".tmp_source.zig:3:5: error: string concatenation requires constant expression");
+ )SOURCE", 1, ".tmp_source.zig:3:5: error: expected array or C string literal, got '[]u8'");
+
+ add_compile_fail_case("non compile time array concatenation", R"SOURCE(
+fn f(s: [10]u8) -> []u8 {
+ s ++ "foo"
+}
+ )SOURCE", 1, ".tmp_source.zig:3:5: error: array concatenation requires constant expression");
add_compile_fail_case("c_import with bogus include", R"SOURCE(
const c = @c_import(@c_include("bogus.h"));