annotate tests/mini/bug61.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 test/bug61.d@d9d5d59873d8
children
rev   line source
lindquist@94 1 module bug61;
lindquist@270 2 extern(C) int printf(char*, ...);
lindquist@94 3
lindquist@94 4 void main()
lindquist@94 5 {
lindquist@94 6 int[3] a = [42,4,141414];
lindquist@94 7 printf("empty:\n");
lindquist@94 8 foreach(v; a[3..$]) {
lindquist@94 9 printf("int = %d\n", v);
lindquist@94 10 }
lindquist@94 11 printf("one element:\n");
lindquist@94 12 foreach(v; a[2..$]) {
lindquist@94 13 printf("int = %d\n", v);
lindquist@94 14 }
lindquist@94 15 printf("all elements:\n");
lindquist@94 16 foreach(v; a) {
lindquist@94 17 printf("int = %d\n", v);
lindquist@94 18 }
lindquist@94 19 printf("empty reversed:\n");
lindquist@94 20 foreach_reverse(v; a[3..$]) {
lindquist@94 21 printf("int = %d\n", v);
lindquist@94 22 }
lindquist@94 23 printf("all elements reversed:\n");
lindquist@94 24 foreach_reverse(v; a) {
lindquist@94 25 printf("int = %d\n", v);
lindquist@94 26 }
lindquist@94 27 }