Mercurial > projects > dstress
comparison run/line_ending_linux.d @ 1560:36bedfa079e6
D1 -> D2 : 2/N
author | thomask |
---|---|
date | Sun, 19 Aug 2007 19:15:01 +0000 |
parents | 9a121126b077 |
children |
comparison
equal
deleted
inserted
replaced
1559:ec5e144583ea | 1560:36bedfa079e6 |
---|---|
19 * @WARNING@ this code depends on the phobos implementation. | 19 * @WARNING@ this code depends on the phobos implementation. |
20 * char[]s returned by wrong assertions have to look like: | 20 * char[]s returned by wrong assertions have to look like: |
21 * "blah blah (linenumber) blah blah" | 21 * "blah blah (linenumber) blah blah" |
22 */ | 22 */ |
23 void checkLineNumber(Object o){ | 23 void checkLineNumber(Object o){ |
24 char[] string=o.toString(); | 24 string x=o.toString(); |
25 | 25 |
26 int start; | 26 int start; |
27 for(start=0; start<string.length; start++){ | 27 for(start=0; start<x.length; start++){ |
28 if(string[start]=='('){ | 28 if(x[start]=='('){ |
29 break; | 29 break; |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 int end; | 33 int end; |
34 for(end=string.length-1; end>start; end--){ | 34 for(end=x.length-1; end>start; end--){ |
35 if(string[end]==')'){ | 35 if(x[end]==')'){ |
36 break; | 36 break; |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 assert(end-start==2); | 40 assert(end-start==2); |
41 assert(string[start+1]=='9'); | 41 assert(x[start+1]=='9'); |
42 } | 42 } |