The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
1.0 KiB
18 lines
1.0 KiB
8 years ago
|
project('pathjoin', 'c')
|
||
|
|
||
8 years ago
|
# Test string-args form since that is the canonical way
|
||
8 years ago
|
assert(join_paths('foo') == 'foo', 'Single argument join is broken')
|
||
|
assert(join_paths('foo', 'bar') == 'foo/bar', 'Path joining is broken')
|
||
|
assert(join_paths('foo', 'bar', 'baz') == 'foo/bar/baz', 'Path joining is broken')
|
||
|
assert(join_paths('/foo', 'bar') == '/foo/bar', 'Path joining is broken')
|
||
|
assert(join_paths('foo', '/bar') == '/bar', 'Absolute path joining is broken')
|
||
|
assert(join_paths('/foo', '/bar') == '/bar', 'Absolute path joining is broken')
|
||
8 years ago
|
|
||
|
# Test array form since people are using that too
|
||
|
assert(join_paths(['foo']) == 'foo', 'Single argument join is broken')
|
||
|
assert(join_paths(['foo', 'bar']) == 'foo/bar', 'Path joining is broken')
|
||
|
assert(join_paths(['foo', 'bar', 'baz']) == 'foo/bar/baz', 'Path joining is broken')
|
||
|
assert(join_paths(['/foo', 'bar']) == '/foo/bar', 'Path joining is broken')
|
||
|
assert(join_paths(['foo', '/bar']) == '/bar', 'Absolute path joining is broken')
|
||
|
assert(join_paths(['/foo', '/bar']) == '/bar', 'Absolute path joining is broken')
|