diff --git a/std/path.d b/std/path.d index 5fb31566b..13694ee87 100644 --- a/std/path.d +++ b/std/path.d @@ -992,7 +992,7 @@ private auto _stripDrive(R)(R path) Returns: index of extension separator (the dot), or -1 if not found */ -private ptrdiff_t extSeparatorPos(R)(const R path) +private ptrdiff_t extSeparatorPos(R)(R path) if (isRandomAccessRange!R && hasLength!R && isSomeChar!(ElementType!R) || isNarrowString!R) { @@ -1280,6 +1280,11 @@ if (isSomeChar!C1 && isSomeChar!C2) assert(withExtension("file.ext"w.byWchar, ".").array == "file."w); } +@safe unittest +{ + assert(chainPath("directory", "file").withExtension(".ext").array == buildPath("directory", "file.ext")); +} + @safe unittest { import std.algorithm.comparison : equal;