|
|
|
@ -27,6 +27,18 @@ original = 'foo.txt' |
|
|
|
|
new = fs.with_suffix(original, '.ini') |
|
|
|
|
assert(new.endswith('foo.ini') and not new.contains('.txt'), 'with_suffix failed') |
|
|
|
|
|
|
|
|
|
original = 'foo' |
|
|
|
|
new = fs.with_suffix(original, '.ini') |
|
|
|
|
assert(new.endswith('foo.ini'), 'with_suffix did not add suffix to suffixless file') |
|
|
|
|
|
|
|
|
|
original = 'foo.dll.a' |
|
|
|
|
new = fs.with_suffix(original, '.so') |
|
|
|
|
assert(new.endswith('foo.dll.so'), 'with_suffix did not only modify last suffix') |
|
|
|
|
|
|
|
|
|
original = 'foo.dll' |
|
|
|
|
new = fs.with_suffix(original, '') |
|
|
|
|
assert(new.endswith('foo'), 'with_suffix did not only delete last suffix') |
|
|
|
|
|
|
|
|
|
# `/` on windows is interpreted like `.drive` which in general may not be `c:/` |
|
|
|
|
# the files need not exist for fs.with_suffix() |
|
|
|
|
original = is_windows ? 'j:/foo/bar.txt' : '/foo/bar.txt' |
|
|
|
|