| 1 |
void test6() |
| 2 |
{ |
| 3 |
string s = q"(foo(xxx))"; |
| 4 |
assert(s == "foo(xxx)"); |
| 5 |
|
| 6 |
s = q"[foo[xxx]]"; |
| 7 |
assert(s == "foo[xxx]"); |
| 8 |
|
| 9 |
s = q"{foo{xxx}}"; |
| 10 |
assert(s == "foo{xxx}"); |
| 11 |
|
| 12 |
s = q"<foo<xxx>>"; |
| 13 |
assert(s == "foo<xxx>"); |
| 14 |
|
| 15 |
s = q"[foo(]"; |
| 16 |
assert(s == "foo("); |
| 17 |
|
| 18 |
s = q"/foo]/"; |
| 19 |
assert(s == "foo]"); |
| 20 |
|
| 21 |
|
| 22 |
s = q"HERE |
| 23 |
foo |
| 24 |
HERE"; |
| 25 |
//writefln("'%s'", s); |
| 26 |
assert(s == "foo\n"); |
| 27 |
|
| 28 |
// https://issues.dlang.org/show_bug.cgi?id=19623 |
| 29 |
s = q"übel |
| 30 |
foo |
| 31 |
übel"; |
| 32 |
assert(s == "foo\n"); |
| 33 |
|
| 34 |
s = q{ foo(xxx) }; |
| 35 |
assert(s ==" foo(xxx) "); |
| 36 |
|
| 37 |
s = q{foo(}; |
| 38 |
assert(s == "foo("); |
| 39 |
|
| 40 |
s = q{{foo}/*}*/}; |
| 41 |
assert(s == "{foo}/*}*/"); |
| 42 |
|
| 43 |
s = q{{foo}"}"}; |
| 44 |
assert(s == "{foo}\"}\""); |
| 45 |
} |
| 46 |
|
| 47 |
/*********************************************************/ |
| 48 |
|
| 49 |
void test7() |
| 50 |
{ |
| 51 |
// auto str = \xDB; |
| 52 |
// assert(str.length == 1); |
| 53 |
} |
| 54 |
|
| 55 |
/*********************************************************/ |
| 56 |
// https://issues.dlang.org/show_bug.cgi?id=4633 |
| 57 |
|
| 58 |
template Types(alias v) |
| 59 |
{ |
| 60 |
alias typeof(v) Types; |
| 61 |
} |
| 62 |
|
| 63 |
typeof({return 1;}()) a; // ok |
| 64 |
Types!({return 1;}()) x; // ok |
| 65 |
|
| 66 |
void test8() |
| 67 |
{ |
| 68 |
typeof({return 1;}()) b; |
| 69 |
Types!({return 1;}()) y; |
| 70 |
} |
| 71 |
|
| 72 |
/*********************************************************/ |
| 73 |
|
| 74 |
enum e13102=184467440737095516153.6L; |
| 75 |
|
| 76 |
/*********************************************************/ |
| 77 |
|
| 78 |
static assert("\∾̳" == "\U0000223E\U00000333"); // ="\xe2\x88\xbe\xcc\xb3" |
| 79 |
|
| 80 |
/*********************************************************/ |
| 81 |
|
| 82 |
int main() |
| 83 |
{ |
| 84 |
test6(); |
| 85 |
test7(); |
| 86 |
test8(); |
| 87 |
|
| 88 |
return 0; |
| 89 |
} |