aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-10 23:38:16 -0500
committerMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-17 00:17:04 -0500
commita320274179ef36aa5aeb4827f777027c3ab3d785 (patch)
tree00c5df8dc958f0e983b33f39f95477e588a71a9a /test cases
parent67651271f60347b2d3cadd235a4abac0b3a1bc16 (diff)
downloadmeson-a320274179ef36aa5aeb4827f777027c3ab3d785.zip
meson-a320274179ef36aa5aeb4827f777027c3ab3d785.tar.gz
meson-a320274179ef36aa5aeb4827f777027c3ab3d785.tar.bz2
fs: get file size
fs: add samefile
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/227 fs module/meson.build14
1 files changed, 14 insertions, 0 deletions
diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build
index a98ed56..2143699 100644
--- a/test cases/common/227 fs module/meson.build
+++ b/test cases/common/227 fs module/meson.build
@@ -54,5 +54,19 @@ sha256 = fs.hash('subdir/subdirfile.txt', 'sha256')
assert(md5 == 'd0795db41614d25affdd548314b30b3b', 'md5sum did not match')
assert(sha256 == 'be2170b0dae535b73f6775694fffa3fd726a43b5fabea11b7342f0605917a42a', 'sha256sum did not match')
+# -- size
+
+size = fs.size('subdir/subdirfile.txt')
+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')
+
+if not is_windows and build_machine.system() != 'cygwin'
+ assert(fs.samefile('a_symlink', 'meson.build'), 'symlink samefile fail')
+endif
subdir('subdir')