aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-03-28 23:25:12 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-03-28 23:25:12 -0400
commit032fccf6151ff201ce4b8c7ab28ca460fed794c0 (patch)
treec784d6f1359e765f640dea70bdc71b77eaec0756 /test
parent5627347bab01fa767c29d1434fcd6a600c98811a (diff)
downloadzig-032fccf6151ff201ce4b8c7ab28ca460fed794c0.tar.gz
zig-032fccf6151ff201ce4b8c7ab28ca460fed794c0.zip
fix compile time array concatenation for slices
closes #866
Diffstat (limited to 'test')
-rw-r--r--test/cases/eval.zig12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/cases/eval.zig b/test/cases/eval.zig
index a5b41275bb..d6f7afe864 100644
--- a/test/cases/eval.zig
+++ b/test/cases/eval.zig
@@ -1,4 +1,5 @@
-const assert = @import("std").debug.assert;
+const std = @import("std");
+const assert = std.debug.assert;
const builtin = @import("builtin");
test "compile time recursion" {
@@ -503,3 +504,12 @@ test "const ptr to comptime mutable data is not memoized" {
assert(foo.read_x() == 2);
}
}
+
+test "array concat of slices gives slice" {
+ comptime {
+ var a: []const u8 = "aoeu";
+ var b: []const u8 = "asdf";
+ const c = a ++ b;
+ assert(std.mem.eql(u8, c, "aoeuasdf"));
+ }
+}