1 // RUNNABLE_PHOBOS_TEST 2 // PERMUTE_ARGS: 3 // EXTRA_FILES: extra-files/teststdio.txt 4 5 import std.stdio; 6 import core.stdc.stdio; 7 main()8void main() 9 { 10 auto f = std.stdio.File("runnable/extra-files/teststdio.txt", "r"); 11 FILE* fp = f.getFP(); 12 string buf; 13 int i; 14 do 15 { 16 buf = f.readln('\n'); 17 foreach (c; buf) 18 printf("%x\n", c); 19 printf("\n"); 20 switch (i) 21 { 22 case 0: assert(buf == "asdfasdf\n"); break; 23 case 1: assert(buf == "a\n"); break; 24 case 2: assert(buf == "sdf\n"); break; 25 case 3: assert(buf == "asdf\n"); break; 26 case 4: assert(buf == "\n"); break; 27 case 5: assert(buf == "\n"); break; 28 case 6: assert(buf == null); break; 29 default: assert(0); 30 } 31 i++; 32 } while (!feof(fp)); 33 //fclose(fp); 34 } 35