aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-18 00:04:33 -0500
committerMichael Hirsch, Ph.D <10931741+scivision@users.noreply.github.com>2020-02-06 12:54:38 -0500
commitdcb7043403b227a8351b5864d5b856a2c81b69b9 (patch)
tree50565125fcfc80b76be5fe6c9786837b33f28395 /test cases
parent4556343d95d8d64c7ab9bbbf1564b53940579f7f (diff)
downloadmeson-dcb7043403b227a8351b5864d5b856a2c81b69b9.zip
meson-dcb7043403b227a8351b5864d5b856a2c81b69b9.tar.gz
meson-dcb7043403b227a8351b5864d5b856a2c81b69b9.tar.bz2
fs: add expanduser method
this should help users specify leading `~` in various Meson options and variables without refactoring lots of places inside Meson itself.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/227 fs module/meson.build8
1 files changed, 6 insertions, 2 deletions
diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build
index 670ffed..8a77fdf 100644
--- a/test cases/common/227 fs module/meson.build
+++ b/test cases/common/227 fs module/meson.build
@@ -30,8 +30,12 @@ assert(fs.is_dir('subprojects'), 'Dir not detected correctly.')
assert(not fs.is_dir('meson.build'), 'File detected as a dir.')
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')
+assert(fs.is_dir('~'), 'home directory not detected')
+assert(not fs.is_file('~'), 'home directory detected as file')
+
+# -- expanduser
+assert(fs.expanduser('~') != '~','expanduser failed')
+assert(fs.expanduser('~/foo').endswith('foo'), 'expanduser with tail failed')
# -- as_posix
assert(fs.as_posix('/') == '/', 'as_posix idempotent')