comparison run/mini/arrays20.d @ 1628:c6ef09dfba4d

add mini test set from ldc project
author Moritz Warning <moritzwarning@web.de>
date Mon, 10 Jan 2011 19:47:18 +0100
parents
children
comparison
equal deleted inserted replaced
1627:e1b954780837 1628:c6ef09dfba4d
1 module mini.arrays20;
2
3 int[] foo()
4 {
5 return [2,4,6];
6 }
7
8 int[] bar()
9 {
10 return [1,3,5];
11 }
12
13 void main()
14 {
15 auto a = foo();
16 auto b = bar();
17 assert(b[0] == 1);
18 assert(a[0] == 2);
19 assert(b[1] == 3);
20 assert(a[1] == 4);
21 assert(b[2] == 5);
22 assert(a[2] == 6);
23 }