aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/array.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behavior/array.zig')
-rw-r--r--test/behavior/array.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/behavior/array.zig b/test/behavior/array.zig
index 155ac294cf..0faa58a7d4 100644
--- a/test/behavior/array.zig
+++ b/test/behavior/array.zig
@@ -45,6 +45,19 @@ fn getArrayLen(a: []const u32) usize {
return a.len;
}
+test "array concat with undefined" {
+ {
+ var array = "hello".* ++ @as([5]u8, undefined);
+ array[5..10].* = "world".*;
+ try std.testing.expect(std.mem.eql(u8, &array, "helloworld"));
+ }
+ {
+ var array = @as([5]u8, undefined) ++ "world".*;
+ array[0..5].* = "hello".*;
+ try std.testing.expect(std.mem.eql(u8, &array, "helloworld"));
+ }
+}
+
test "array concat with tuple" {
const array: [2]u8 = .{ 1, 2 };
{