Commit | Line | Data |
---|---|---|
a7ec569c RJ |
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! | |
4 | ||
5 | by Pjotr Prins <pjotr.guix@thebird.nl> | |
6 | ||
1b541c3e PP |
7 | --- a/std/datetime.d.orig 2016-11-24 01:13:52.584495545 +0100 |
8 | +++ b/std/datetime.d 2016-11-24 01:17:09.655306728 +0100 | |
e44b5112 | 9 | @@ -28081,22 +28081,24 @@ |
a7ec569c RJ |
10 | import std.range : retro; |
11 | import std.format : format; | |
1b541c3e | 12 | |
a7ec569c RJ |
13 | - name = strip(name); |
14 | - | |
15 | enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir))); | |
16 | enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir))); | |
1b541c3e | 17 | |
e44b5112 DM |
18 | version(Android) |
19 | { | |
20 | + name = strip(name); | |
21 | auto tzfileOffset = name in tzdataIndex(tzDatabaseDir); | |
22 | enforce(tzfileOffset, new DateTimeException(format("The time zone %s is not listed.", name))); | |
23 | string tzFilename = separate_index ? "zoneinfo.dat" : "tzdata"; | |
24 | immutable file = buildNormalizedPath(tzDatabaseDir, tzFilename); | |
25 | } | |
26 | else | |
27 | - immutable file = buildNormalizedPath(tzDatabaseDir, name); | |
28 | + { | |
29 | + auto filename = "./" ~ strip(name); // make sure the prefix is not stripped | |
30 | + immutable file = buildNormalizedPath(tzDatabaseDir, filename); | |
31 | + } | |
1b541c3e | 32 | |
a7ec569c RJ |
33 | - enforce(file.exists(), new DateTimeException(format("File %s does not exist.", file))); |
34 | + enforce(file.exists(), new DateTimeException(format("File %s does not exist in %s.", file, tzDatabaseDir))); | |
35 | enforce(file.isFile, new DateTimeException(format("%s is not a file.", file))); | |
1b541c3e | 36 | |
a7ec569c RJ |
37 | auto tzFile = File(file); |
38 | diff --git a/std/path.d b/std/path.d | |
39 | index 254d8f0..b0fc04d 100644 | |
40 | --- a/std/path.d | |
41 | +++ b/std/path.d | |
42 | @@ -3080,8 +3080,11 @@ unittest | |
43 | } | |
44 | else | |
45 | { | |
46 | + pragma(msg, "test disabled on GNU Guix"); | |
47 | +/* | |
48 | assert(expandTilde("~root") == "/root", expandTilde("~root")); | |
49 | assert(expandTilde("~root/") == "/root/", expandTilde("~root/")); | |
50 | +*/ | |
51 | } | |
52 | assert(expandTilde("~Idontexist/hey") == "~Idontexist/hey"); | |
53 | } | |
54 | diff --git a/std/socket.d b/std/socket.d | |
55 | index b85d1c9..7fbf346 100644 | |
56 | --- a/std/socket.d | |
57 | +++ b/std/socket.d | |
a7ec569c | 58 | @@ -859,6 +862,8 @@ class InternetHost |
1b541c3e | 59 | |
a7ec569c RJ |
60 | unittest |
61 | { | |
62 | + pragma(msg, "test disabled on GNU Guix"); | |
63 | + /* | |
64 | InternetHost ih = new InternetHost; | |
1b541c3e | 65 | |
a7ec569c RJ |
66 | ih.getHostByAddr(0x7F_00_00_01); |
67 | @@ -889,6 +894,7 @@ unittest | |
68 | // writefln("aliases[%d] = %s", i, s); | |
69 | // } | |
70 | }); | |
71 | + */ | |
72 | } |