summaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-10-21 09:47:39 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2023-11-24 22:15:14 +0200
commit85e4ee5b54c334d4104e6c3b2f3fda11cd9b2dd6 (patch)
tree556dfe82f07a9738c003ff18ff6ef2f78c679a6c /test cases/common
parent7f5f432ec98c1961b0b9712f36cec3ae3c5cd9f9 (diff)
downloadmeson-85e4ee5b54c334d4104e6c3b2f3fda11cd9b2dd6.tar.gz
File: Add full_path() method
This is needed now that str.format() is not allowing it any more. It is also more consistent with other objects that have that method as well, such as build targets. Fixes: #12406
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/74 file object/meson.build6
1 files changed, 6 insertions, 0 deletions
diff --git a/test cases/common/74 file object/meson.build b/test cases/common/74 file object/meson.build
index fc01bfec7..05c24aef8 100644
--- a/test cases/common/74 file object/meson.build
+++ b/test cases/common/74 file object/meson.build
@@ -6,3 +6,9 @@ test('fobj', executable('fobj', prog0, lib0))
subdir('subdir1')
subdir('subdir2')
+
+# Use fs.as_posix() because / operator replaces \ with / in the path, but
+# full_path() method is not doing that. This is a pretty inconsistent across all
+# Meson APIs.
+fs = import('fs')
+assert(fs.as_posix(prog0[0].full_path()) == fs.as_posix(meson.current_source_dir() / 'prog.c'))