annotate run/mini/aaequality.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1628
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
1 void test(K,V)(K k1, V v1, K k2, V v2, K k3, V v3)
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
2 {
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
3 V[K] a, b;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
4 a[k1] = v1;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
5 a[k2] = v2;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
6 assert(a != b);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
7 assert(b != a);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
8 assert(a == a);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
9 assert(b == b);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
10
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
11 b[k1] = v1;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
12 assert(a != b);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
13 assert(b != a);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
14
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
15 b[k2] = v2;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
16 assert(a == b);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
17 assert(b == a);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
18
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
19 b[k1] = v2;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
20 assert(a != b);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
21 assert(b != a);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
22
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
23 b[k1] = v1;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
24 b[k2] = v3;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
25 assert(a != b);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
26 assert(b != a);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
27
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
28 b[k2] = v2;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
29 b[k3] = v3;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
30 assert(a != b);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
31 assert(b != a);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
32 }
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
33
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
34 void main()
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
35 {
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
36 test!(int,int)(1, 2, 3, 4, 5, 6);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
37 test!(char[],int)("abc", 2, "def", 4, "geh", 6);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
38 test!(int,char[])(1, "abc", 2, "def", 3, "geh");
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
39 test!(char[],char[])("123", "abc", "456", "def", "789", "geh");
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
40
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
41 Object a = new Object, b = new Object, c = new Object;
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
42 test!(Object, Object)(a, a, b, b, c, c);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
43
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
44 int[int] a2 = [1:2, 2:3, 3:4];
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
45 int[int] b2 = [1:2, 2:5, 3:4];
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
46 int[int] c2 = [1:2, 2:3];
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
47 test!(int,int[int])(1,a2, 2,b2, 3,c2);
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff changeset
48 }