aboutsummaryrefslogtreecommitdiff
blob: 5b67c5d0cd3a7e6e15c5bb8b577cc1bae287da3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/runtime/phobos/std/file.d b/runtime/phobos/std/file.d
index 5b8925d..f1b19b3 100644
--- a/runtime/phobos/std/file.d
+++ b/runtime/phobos/std/file.d
@@ -1082,6 +1082,7 @@ private void removeImpl(scope const(char)[] name, scope const(FSChar)* namez) @t
 
 @safe unittest
 {
+    import std.algorithm.searching : startsWith;
     import std.exception : collectExceptionMsg, assertThrown;
 
     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);