mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
parent
ab46287e18
commit
fb602efdc4
1 changed files with 2 additions and 2 deletions
|
@ -1801,7 +1801,7 @@ expression.
|
||||||
@system unittest
|
@system unittest
|
||||||
{
|
{
|
||||||
import std.format : format;
|
import std.format : format;
|
||||||
assert("%s".format.ifThrown!Exception(e => e.classinfo.name) == "std.format.FormatException");
|
assert("%s".format.ifThrown!Exception(e => typeid(e).name) == "std.format.FormatException");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Verify Examples
|
//Verify Examples
|
||||||
|
@ -1834,7 +1834,7 @@ expression.
|
||||||
static assert(!__traits(compiles, (new Object()).ifThrown(1)));
|
static assert(!__traits(compiles, (new Object()).ifThrown(1)));
|
||||||
|
|
||||||
//Use a lambda to get the thrown object.
|
//Use a lambda to get the thrown object.
|
||||||
assert("%s".format().ifThrown(e => e.classinfo.name) == "std.format.FormatException");
|
assert("%s".format().ifThrown(e => typeid(e).name) == "std.format.FormatException");
|
||||||
}
|
}
|
||||||
|
|
||||||
@system unittest
|
@system unittest
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue