mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +03:00
Merge pull request #8956 from the-horo/file.d-unittest-fix
std/file.d: Don't check for OS-dependent error message in unittest
This commit is contained in:
commit
fb24ef3d0e
1 changed files with 2 additions and 3 deletions
|
@ -1083,6 +1083,7 @@ private void removeImpl(scope const(char)[] name, scope const(FSChar)* namez) @t
|
|||
@safe unittest
|
||||
{
|
||||
import std.exception : collectExceptionMsg, assertThrown;
|
||||
import std.algorithm.searching : startsWith;
|
||||
|
||||
string filename = null; // e.g. as returned by File.tmpfile.name
|
||||
|
||||
|
@ -1090,12 +1091,10 @@ private void removeImpl(scope const(char)[] name, scope const(FSChar)* namez) @t
|
|||
{
|
||||
// exact exception message is OS-dependent
|
||||
auto msg = filename.remove.collectExceptionMsg!FileException;
|
||||
assert("Failed to remove file (null): Bad address" == msg, msg);
|
||||
assert(msg.startsWith("Failed to remove file (null):"), msg);
|
||||
}
|
||||
else version (Windows)
|
||||
{
|
||||
import std.algorithm.searching : startsWith;
|
||||
|
||||
// don't test exact message on windows, it's language dependent
|
||||
auto msg = filename.remove.collectExceptionMsg!FileException;
|
||||
assert(msg.startsWith("(null):"), msg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue