Mercurial > projects > dstress
annotate run/InExpression_06.d @ 1597:8b9d4d2f925a
Fix typos in complex tests. See D bug 614.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 09 Sep 2008 16:53:58 +0200 |
parents | 557e7af55dfc |
children |
rev | line source |
---|---|
180 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.InExpression_06; | |
6 | |
7 struct MyStruct{ | |
8 int i; | |
9 char c; | |
10 } | |
11 | |
12 int main(){ | |
13 MyStruct value; | |
14 value.i = 1; | |
15 value.c = '1'; | |
16 char[] key = "eins"; | |
17 MyStruct[char[]] array; | |
18 | |
19 array[key]=value; | |
20 MyStruct* ptr = key in array; | |
21 | |
22 assert(value.i == ptr.i); | |
23 assert(value.c == ptr.c); | |
24 | |
25 value.i++; | |
26 value.c--; | |
27 | |
312
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
28 assert(value.i != ptr.i); |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
29 assert(value.c != ptr.c); |
180 | 30 |
31 return 0; | |
32 } |