diff options
| author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-11-08 03:43:49 -0500 |
|---|---|---|
| committer | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-11-17 00:17:02 -0500 |
| commit | 052d918908b4e571a42cd3fc539933f9db139e0c (patch) | |
| tree | 9ca08b87ffee43e27b19845c74996cf1abe5574a /test cases | |
| parent | dc8e8f06441030fc1d7f16a8444964ea5a125321 (diff) | |
| download | meson-052d918908b4e571a42cd3fc539933f9db139e0c.tar.gz | |
add fs.with_suffix
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/common/227 fs module/meson.build | 13 |
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 30d193fc6..fcb08c0b4 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') |
