mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
7 lines
828 B
HTML
7 lines
828 B
HTML
<!--
|
|
PERMUTE_ARGS: -d -dw
|
|
TEST_OUTPUT:
|
|
---
|
|
Error: unrecognized file extension html
|
|
---
|
|
--><html>
|
|
<head><title>dstress: html_line_ending_mac</title></head>
|
|
<body><pre><CODE>
|
|
// __DSTRESS_TORTURE_BLOCK__ -release
|
|
int main(){
|
|
try{
|
|
assert(0);
|
|
}catch(Throwable e){
|
|
checkLineNumber(e);
|
|
return 0;
|
|
}
|
|
assert(-1, "b");
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
* @WARNING@ this code depends on the phobos implementation.
|
|
* char[]s returned by wrong assertions have to look like:
|
|
* "blah blah (linenumber) blah blah"
|
|
*/
|
|
void checkLineNumber(Object o){
|
|
string x=o.toString();
|
|
|
|
int start;
|
|
for(start=0; start<x.length; start++){if(x[start]=='('){break;}}
|
|
|
|
int end;
|
|
for(end=start+1; end<x.length; end++){if(x[end]==')'){break;}}
|
|
|
|
assert(end-start==3);
|
|
assert(x[start+1 .. end]=="10", x[start+1 .. end]);
|
|
}
|
|
</CODE></pre></body>
|
|
</html>
|