Mercurial > projects > dstress
annotate run/line_token_04.d @ 1560:36bedfa079e6
D1 -> D2 : 2/N
author | thomask |
---|---|
date | Sun, 19 Aug 2007 19:15:01 +0000 |
parents | 9a121126b077 |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
756 | 5 // __DSTRESS_TORTURE_BLOCK__ -release |
6 | |
70
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
37
diff
changeset
|
7 module dstress.run.line_token_04; |
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
37
diff
changeset
|
8 |
37 | 9 int main(){ |
10 try{ | |
11 #line 0 "a" | |
12 assert(0); | |
70
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
37
diff
changeset
|
13 }catch(Object o){ |
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
37
diff
changeset
|
14 checkFileSpec(o); |
37 | 15 return 0; |
16 } | |
17 | |
70
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
37
diff
changeset
|
18 assert(0); |
37 | 19 } |
20 | |
21 /* | |
22 * @WARNING@: this code depends on the phobos implementation. | |
23 * char[]s returned by wrong assertions have to look like: | |
435 | 24 * "blah blah filename(123) blah blah" |
37 | 25 */ |
26 void checkFileSpec(Object o){ | |
1560 | 27 string x=o.toString(); |
37 | 28 |
29 int start; | |
1560 | 30 for(start=0; start<x.length; start++){ |
31 if(x[start]=='('){ | |
37 | 32 break; |
33 } | |
34 } | |
35 | |
1560 | 36 assert(x[start-2 .. start+3]==" a(0)"); |
37 | 37 } |