1
0

cFile:ChangeFileExt now accepts extensions with leading dot, too.

This commit is contained in:
Mattes D
2015-04-11 17:42:32 +02:00
parent c4842cb9aa
commit 79e8f8fb20
3 changed files with 25 additions and 4 deletions

View File

@@ -84,10 +84,19 @@ end;
function TestFileExt()
assert(cFile:ChangeFileExt("fileless_dir/", "new") == "fileless_dir/")
assert(cFile:ChangeFileExt("fileless_dir/", ".new") == "fileless_dir/")
assert(cFile:ChangeFileExt("pathless_file.ext", "new") == "pathless_file.new")
assert(cFile:ChangeFileExt("pathless_file.ext", ".new") == "pathless_file.new")
assert(cFile:ChangeFileExt("path/to/file.ext", "new") == "path/to/file.new")
assert(cFile:ChangeFileExt("path/to/file.ext", ".new") == "path/to/file.new")
assert(cFile:ChangeFileExt("path/to.dir/file", "new") == "path/to.dir/file.new")
assert(cFile:ChangeFileExt("path/to.dir/file", ".new") == "path/to.dir/file.new")
assert(cFile:ChangeFileExt("path/to.dir/file.ext", "new") == "path/to.dir/file.new")
assert(cFile:ChangeFileExt("path/to.dir/file.ext", ".new") == "path/to.dir/file.new")
assert(cFile:ChangeFileExt("path/to.dir/file.longext", "new") == "path/to.dir/file.new")
assert(cFile:ChangeFileExt("path/to.dir/file.longext", ".new") == "path/to.dir/file.new")
assert(cFile:ChangeFileExt("path/to.dir/file.", "new") == "path/to.dir/file.new")
assert(cFile:ChangeFileExt("path/to.dir/file.", ".new") == "path/to.dir/file.new")
end