aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-12-18 23:17:06 -0500
committerXavier Claessens <xclaesse@gmail.com>2019-12-19 08:51:31 -0500
commitfb121f62548bf6d18778d26dd917ae00e1d2c6ef (patch)
tree30d70f65f732386ee0a618f649fb0d4daed32b6d /test cases
parent9e219427803c68a24fcc6afa1fb3bbe8a5e4800d (diff)
downloadmeson-fb121f62548bf6d18778d26dd917ae00e1d2c6ef.zip
meson-fb121f62548bf6d18778d26dd917ae00e1d2c6ef.tar.gz
meson-fb121f62548bf6d18778d26dd917ae00e1d2c6ef.tar.bz2
fs: rename samefile => is_samepath
is_samepath better reflects the nature of this function--that files and directories can be compared. Also, instead of raising exceptions, simply return False when one or both .is_samepath(path1, path1) don't exist. This is more intuitive behavior and avoids having an extra if fs.exist() to go with every fs.is_samepath()
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/227 fs module/meson.build8
1 files changed, 5 insertions, 3 deletions
diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build
index 131dcf3..ef92df1 100644
--- a/test cases/common/227 fs module/meson.build
+++ b/test cases/common/227 fs module/meson.build
@@ -62,11 +62,13 @@ assert(size == 19, 'file size not found correctly')
# -- are filenames referring to the same file?
f1 = 'meson.build'
f2 = 'subdir/../meson.build'
-assert(fs.samefile(f1, f2), 'samefile not realized')
-assert(not fs.samefile(f1, 'subdir/subdirfile.txt'), 'samefile known bad comparison')
+assert(fs.is_samepath(f1, f2), 'is_samepath not detercting same files')
+assert(fs.is_samepath(meson.source_root(), 'subdir/..'), 'is_samepath not detecting same directory')
+assert(not fs.is_samepath(f1, 'subdir/subdirfile.txt'), 'is_samepath known bad comparison')
+assert(not fs.is_samepath('not-a-path', f2), 'is_samepath should not error if path(s) do not exist')
if not is_windows and build_machine.system() != 'cygwin'
- assert(fs.samefile('a_symlink', 'meson.build'), 'symlink samefile fail')
+ assert(fs.is_samepath('a_symlink', 'meson.build'), 'symlink is_samepath fail')
endif
assert(fs.parent('foo/bar') == 'foo', 'failed to get dirname')