aboutsummaryrefslogtreecommitdiff
path: root/libphobos/testsuite/libphobos.phobos/std_array.d
diff options
context:
space:
mode:
Diffstat (limited to 'libphobos/testsuite/libphobos.phobos/std_array.d')
-rw-r--r--libphobos/testsuite/libphobos.phobos/std_array.d17
1 files changed, 17 insertions, 0 deletions
diff --git a/libphobos/testsuite/libphobos.phobos/std_array.d b/libphobos/testsuite/libphobos.phobos/std_array.d
index 1370d08..87ea0f0 100644
--- a/libphobos/testsuite/libphobos.phobos/std_array.d
+++ b/libphobos/testsuite/libphobos.phobos/std_array.d
@@ -451,6 +451,23 @@
int[] a = [ 1, 2 ];
auto app2 = appender(a);
app2.put(3);
+ app2.put([ 4, 5, 6 ]);
+ assert(app2[] == [ 1, 2, 3, 4, 5, 6 ]);
+}
+
+@safe pure nothrow unittest
+{
+ import std.array;
+
+ auto app = appender!string();
+ string b = "abcdefg";
+ foreach (char c; b)
+ app.put(c);
+ assert(app[] == "abcdefg");
+
+ int[] a = [ 1, 2 ];
+ auto app2 = appender(a);
+ app2.put(3);
assert(app2.length == 3);
app2.put([ 4, 5, 6 ]);
assert(app2[] == [ 1, 2, 3, 4, 5, 6 ]);