mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-13 19:33:13 +01:00
19 lines
334 B
D
19 lines
334 B
D
module tangotests.foreach1;
|
|
|
|
extern(C) int printf(char*, ...);
|
|
|
|
int main(){
|
|
dchar[] array="\u2260";
|
|
int test=0;
|
|
int count=0;
|
|
assert(count==0);
|
|
foreach(int index, char obj; array){
|
|
printf("%d\n", obj);
|
|
test+=obj;
|
|
count++;
|
|
}
|
|
assert(count==3);
|
|
assert(test==0x20b);
|
|
return 0;
|
|
}
|