aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-08 03:43:49 -0500
committerMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-17 00:17:02 -0500
commit052d918908b4e571a42cd3fc539933f9db139e0c (patch)
tree9ca08b87ffee43e27b19845c74996cf1abe5574a /test cases
parentdc8e8f06441030fc1d7f16a8444964ea5a125321 (diff)
downloadmeson-052d918908b4e571a42cd3fc539933f9db139e0c.zip
meson-052d918908b4e571a42cd3fc539933f9db139e0c.tar.gz
meson-052d918908b4e571a42cd3fc539933f9db139e0c.tar.bz2
add fs.with_suffix
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/227 fs module/meson.build13
1 files changed, 13 insertions, 0 deletions
diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build
index 30d193f..fcb08c0 100644
--- a/test cases/common/227 fs module/meson.build
+++ b/test cases/common/227 fs module/meson.build
@@ -21,4 +21,17 @@ assert(not fs.is_dir('nonexisting'), 'Bad path detected as a dir.')
assert(fs.is_dir('~'), 'expanduser not working')
assert(not fs.is_file('~'), 'expanduser not working')
+original = 'foo.txt'
+new = fs.with_suffix(original, '.ini')
+assert(new.endswith('foo.ini') and not new.contains('.txt'), 'with_suffix failed')
+
+if build_machine.system() != 'windows'
+ # this feature works on Windows, but `/` on windows is interpreted like `.drive` which in general may not be `c:/`
+ # so we omit this from self-test on Windows
+
+ original = '/opt/foo.txt'
+ new = fs.with_suffix(original, '.ini')
+ assert(new == '/opt/foo.ini', 'absolute path with_suffix failed')
+endif
+
subdir('subdir')