Mercurial > projects > ldc
comparison tests/mini/foreach8.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | |
children | 30b42a283c8e |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module tangotests.foreach1; | |
2 | |
3 extern(C) int printf(char*, ...); | |
4 | |
5 int main(){ | |
6 dchar[] array="\u2260"; | |
7 int test=0; | |
8 int count=0; | |
9 assert(count==0); | |
10 foreach(int index, char obj; array){ | |
11 printf("%d\n", obj); | |
12 test+=obj; | |
13 count++; | |
14 } | |
15 assert(count==3); | |
16 assert(test==0x20b); | |
17 return 0; | |
18 } |