Mercurial > projects > ldc
diff test/arrays4.d @ 40:8b0e809563df trunk
[svn r44] Lots of bug fixes.
New array literal support
New array ~= operator support (for single element)
New with statement support
More...
author | lindquist |
---|---|
date | Fri, 19 Oct 2007 07:43:21 +0200 |
parents | 77cdca8c210f |
children | c44e6a711885 |
line wrap: on
line diff
--- a/test/arrays4.d Wed Oct 10 06:21:31 2007 +0200 +++ b/test/arrays4.d Fri Oct 19 07:43:21 2007 +0200 @@ -1,9 +1,14 @@ module arrays4; - +import std.stdio; void main() { - auto arr = new int[4]; - auto arrcat = arr ~ arr; - assert(arrcat.length == arr.length * 2); + int[] arr; + arr ~= 3; + assert(arr.length == 1); + assert(arr[0] == 3); + arr ~= 5; + assert(arr.length == 2); + assert(arr[0] == 3); + assert(arr[1] == 5); + writefln(arr); } -