diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2023-07-10 17:16:17 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2023-07-10 23:31:29 +0200 |
commit | e9251fea2debebfebe1f762a4a8d5b3b1d4c75ef (patch) | |
tree | 09b47f4d760019131aa27d19bfb8e5ee0f1ed31f /libphobos/src/std/path.d | |
parent | 2d7c95e31431a297060c94697af84f498abf97a2 (diff) | |
download | gcc-e9251fea2debebfebe1f762a4a8d5b3b1d4c75ef.zip gcc-e9251fea2debebfebe1f762a4a8d5b3b1d4c75ef.tar.gz gcc-e9251fea2debebfebe1f762a4a8d5b3b1d4c75ef.tar.bz2 |
d: Merge upstream dmd, druntime a88e1335f7, phobos 1921d29df.
D front-end changes:
- Import dmd v2.104.1.
- Deprecation phase ended for access to private method when
overloaded with public method.
D runtime changes:
- Import druntime v2.104.1.
- Linux input header translations were added to druntime.
- Integration with the Valgrind `memcheck' tool has been added
to the garbage collector.
Phobos changes:
- Import phobos v2.104.1.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd a88e1335f7.
* dmd/VERSION: Bump version to v2.104.1.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime a88e1335f7.
* src/MERGE: Merge upstream phobos 1921d29df.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac (libphobos-checking): Add valgrind flag.
(DRUNTIME_LIBRARIES_VALGRIND): Call.
* libdruntime/Makefile.am (DRUNTIME_CSOURCES): Add
etc/valgrind/valgrind_.c.
(DRUNTIME_DSOURCES): Add etc/valgrind/valgrind.d.
(DRUNTIME_DSOURCES_LINUX): Add core/sys/linux/input.d,
core/sys/linux/input_event_codes.d, core/sys/linux/uinput.d.
* libdruntime/Makefile.in: Regenerate.
* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_VALGRIND): Define.
Diffstat (limited to 'libphobos/src/std/path.d')
-rw-r--r-- | libphobos/src/std/path.d | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/libphobos/src/std/path.d b/libphobos/src/std/path.d index e81f2b6..449235a 100644 --- a/libphobos/src/std/path.d +++ b/libphobos/src/std/path.d @@ -1595,7 +1595,7 @@ if (isSomeChar!C) @safe unittest { - // Test for issue 7397 + // Test for https://issues.dlang.org/show_bug.cgi?id=7397 string[] ary = ["a", "b"]; version (Posix) { @@ -1875,7 +1875,7 @@ if (isSomeChar!C) @safe unittest { - // Test for issue 7397 + // Test for https://issues.dlang.org/show_bug.cgi?id=7397 string[] ary = ["a", "b"]; version (Posix) { @@ -2745,7 +2745,7 @@ else version (Posix) See_Also: $(LREF asAbsolutePath) which does not allocate */ -string absolutePath(string path, lazy string base = getcwd()) +string absolutePath(return scope const string path, lazy string base = getcwd()) @safe pure { import std.array : array; @@ -2792,6 +2792,19 @@ string absolutePath(string path, lazy string base = getcwd()) assertThrown(absolutePath("bar", "foo")); } +// Ensure that we can call absolute path with scope paramaters +@safe unittest +{ + string testAbsPath(scope const string path, scope const string base) { + return absolutePath(path, base); + } + + version (Posix) + assert(testAbsPath("some/file", "/foo/bar") == "/foo/bar/some/file"); + version (Windows) + assert(testAbsPath(`some\file`, `c:\foo\bar`) == `c:\foo\bar\some\file`); +} + /** Transforms `path` into an absolute path. The following algorithm is used: @@ -3559,7 +3572,8 @@ if (isConvertibleToString!Range) assert(!globMatch("foo.bar", "[gh]???bar")); assert(!globMatch("foo.bar"w, "[!fg]*bar"w)); assert(!globMatch("foo.bar"d, "[fg]???baz"d)); - assert(!globMatch("foo.di", "*.d")); // test issue 6634: triggered bad assertion + // https://issues.dlang.org/show_bug.cgi?id=6634 + assert(!globMatch("foo.di", "*.d")); // triggered bad assertion assert(globMatch("foo.bar", "{foo,bif}.bar")); assert(globMatch("bif.bar"w, "{foo,bif}.bar"w)); |