1 This patch fixes a failing unit test by feeding buildNormalizedPath to the
2 tzdata properly. Three other tests are disabled, one assumes /root and the
3 two others use networking. Not bad out of almost 700 tests!
5 by Pjotr Prins <pjotr.guix@thebird.nl>
7 diff --git a/std/datetime.d b/std/datetime.d
8 index 8e4ed3b..6c15bc5 100644
11 @@ -28018,6 +28018,7 @@ public:
12 The default directory where the TZ Database files are. It's empty
13 for Windows, since Windows doesn't have them.
16 enum defaultTZDatabaseDir = "/usr/share/zoneinfo/";
19 @@ -28069,14 +28070,13 @@ assert(tz.dstName == "PDT");
20 import std.range : retro;
21 import std.format : format;
25 enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
26 enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
28 - immutable file = buildNormalizedPath(tzDatabaseDir, name);
29 + auto filename = "./" ~ strip(name); // make sure the prefix is not stripped
30 + immutable file = buildNormalizedPath(tzDatabaseDir, filename);
32 - enforce(file.exists(), new DateTimeException(format("File %s does not exist.", file)));
33 + enforce(file.exists(), new DateTimeException(format("File %s does not exist in %s.", file, tzDatabaseDir)));
34 enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
36 auto tzFile = File(file);
37 diff --git a/std/path.d b/std/path.d
38 index 254d8f0..b0fc04d 100644
41 @@ -3080,8 +3080,11 @@ unittest
45 + pragma(msg, "test disabled on GNU Guix");
47 assert(expandTilde("~root") == "/root", expandTilde("~root"));
48 assert(expandTilde("~root/") == "/root/", expandTilde("~root/"));
51 assert(expandTilde("~Idontexist/hey") == "~Idontexist/hey");
53 diff --git a/std/socket.d b/std/socket.d
54 index b85d1c9..7fbf346 100644
57 @@ -517,6 +517,8 @@ class Protocol
61 + pragma(msg, "test disabled on GNU Guix");
63 // getprotobyname,number are unimplemented on Android
65 Protocol proto = new Protocol;
66 @@ -530,6 +532,7 @@ unittest
67 assert(proto.name == "tcp");
68 assert(proto.aliases.length == 1 && proto.aliases[0] == "TCP");
74 @@ -859,6 +862,8 @@ class InternetHost
78 + pragma(msg, "test disabled on GNU Guix");
80 InternetHost ih = new InternetHost;
82 ih.getHostByAddr(0x7F_00_00_01);
83 @@ -889,6 +894,7 @@ unittest
84 // writefln("aliases[%d] = %s", i, s);