annotate tests/mini/foreach8.d @ 1651:cb960b882ca3 tip

bindings were moved to dsource.org/projects/bindings/
author Moritz Warning <moritzwarning@web.de>
date Thu, 20 May 2010 20:05:03 +0200
parents 30b42a283c8e
children
rev   line source
tomas@715 1 module mini.foreach8;
lindquist@341 2
lindquist@341 3 extern(C) int printf(char*, ...);
lindquist@341 4
lindquist@341 5 int main(){
lindquist@341 6 dchar[] array="\u2260";
tomas@715 7 printf("array[0] == %u\n", array[0]);
lindquist@341 8 int test=0;
lindquist@341 9 int count=0;
lindquist@341 10 assert(count==0);
lindquist@341 11 foreach(int index, char obj; array){
lindquist@341 12 printf("%d\n", obj);
lindquist@341 13 test+=obj;
lindquist@341 14 count++;
lindquist@341 15 }
lindquist@341 16 assert(count==3);
lindquist@341 17 assert(test==0x20b);
lindquist@341 18 return 0;
lindquist@341 19 }