diff options
Diffstat (limited to 'tests/modules/path/test.lua')
| -rw-r--r-- | tests/modules/path/test.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/modules/path/test.lua b/tests/modules/path/test.lua new file mode 100644 index 000000000..bba15810c --- /dev/null +++ b/tests/modules/path/test.lua @@ -0,0 +1,27 @@ +function test_splitenv_win(t) + if not is_host("windows") then + return + end + t:are_equal(path.splitenv(""), {}) + t:are_equal(path.splitenv("a"), {'a'}) + t:are_equal(path.splitenv("a;b"), {'a','b'}) + t:are_equal(path.splitenv(";;a;;b;"), {'a','b'}) + t:are_equal(path.splitenv('c:/a;c:\\b'), {'c:/a', 'c:\\b'}) + t:are_equal(path.splitenv('"a;aa;aa;;"'), {"a;aa;aa;;"}) + t:are_equal(path.splitenv('"a;aa;aa;;";bb;;'), {"a;aa;aa;;", 'bb'}) + t:are_equal(path.splitenv('"a;aa;aa;;";"a;cc;aa;;";bb;"d";'), {"a;aa;aa;;","a;cc;aa;;", 'bb', 'd' }) +end + +function test_splitenv_unix(t) + if is_host("windows") then + return + end + t:are_equal(path.splitenv(""), {}) + t:are_equal(path.splitenv("a"), {'a'}) + t:are_equal(path.splitenv("a:b"), {'a','b'}) + t:are_equal(path.splitenv("::a::b:"), {'a','b'}) + t:are_equal(path.splitenv('a%tag:b'), {'a','b'}) + t:are_equal(path.splitenv('a%tag:b%tag'), {'a','b'}) + t:are_equal(path.splitenv('a%tag:b%%tag%%'), {'a','b'}) + t:are_equal(path.splitenv('a%tag:b:%tag:'), {'a','b'}) +end
\ No newline at end of file |
