Mercurial > projects > dstress
annotate run/foreach_15.d @ 1535:20d8ee6523e1
updated to DMD-1.013
author | thomask |
---|---|
date | Mon, 07 May 2007 05:19:57 +0000 |
parents | f87ba6507260 |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
0 | 4 |
374 | 5 module dstress.run.foreach_15; |
0 | 6 |
7 int main(){ | |
8 char[3] array; | |
9 array[0]='a'; | |
10 array[1]='b'; | |
11 array[2]='c'; | |
12 int count=0; | |
13 assert(count==0); | |
14 assert(array[0]=='a'); | |
15 assert(array[1]=='b'); | |
16 assert(array[2]=='c'); | |
1535 | 17 foreach(ref char value; array){ |
0 | 18 count++; |
19 value++; | |
20 } | |
21 assert(count==3); | |
22 assert(array[0]=='b'); | |
23 assert(array[1]=='c'); | |
24 assert(array[2]=='d'); | |
25 return 0; | |
26 } |