Mercurial > projects > dstress
annotate run/foreach_09.d @ 1619:bebc7472a832
Fix #7.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 07 Nov 2009 18:55:30 +0100 |
parents | f87ba6507260 |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
0 | 4 |
374 | 5 module dstress.run.foreach_09; |
0 | 6 |
7 int main(){ | |
8 double[dchar[]] array; | |
9 array["eins"]= 1.0; | |
10 array["drei"]= 3.0; | |
11 double test=0.0; | |
12 int count=0; | |
13 assert(count==0); | |
14 foreach(double obj; array){ | |
15 test+=obj; | |
16 count++; | |
17 } | |
18 assert(count==2); | |
19 assert(test==4.0); | |
20 return 0; | |
1 | 21 } |