diff options
| author | Hisham <hisham@gobolinux.org> | 2016-10-28 11:58:04 -0200 |
|---|---|---|
| committer | Hisham <hisham@gobolinux.org> | 2016-10-28 11:58:04 -0200 |
| commit | 825f903a29df24b912e77e48d8b59e43e3a72029 (patch) | |
| tree | 5cc9180d281beb4e78535779849cd4e306d25b03 /spec | |
| parent | 66cc4dfe45b4691a83b1b234bb626b60c16fd020 (diff) | |
| parent | afd9b2a4f2187b802f1febcff9b54073c6d8943d (diff) | |
| download | luarocks-825f903a29df24b912e77e48d8b59e43e3a72029.tar.gz luarocks-825f903a29df24b912e77e48d8b59e43e3a72029.tar.bz2 luarocks-825f903a29df24b912e77e48d8b59e43e3a72029.zip | |
Merge branch 'master' of https://github.com/keplerproject/luarocks
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/fs_spec.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua new file mode 100644 index 00000000..c76f47a4 --- /dev/null +++ b/spec/fs_spec.lua | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | local test_env = require("test/test_environment") | ||
| 2 | |||
| 3 | test_env.unload_luarocks() | ||
| 4 | local fs = require("luarocks.fs") | ||
| 5 | local is_win = test_env.TEST_TARGET_OS == "windows" | ||
| 6 | |||
| 7 | describe("Luarocks fs test #whitebox #w_fs", function() | ||
| 8 | describe("fs.Q", function() | ||
| 9 | it("simple argument", function() | ||
| 10 | assert.are.same(is_win and '"foo"' or "'foo'", fs.Q("foo")) | ||
| 11 | end) | ||
| 12 | |||
| 13 | it("argument with quotes", function() | ||
| 14 | assert.are.same(is_win and [["it's \"quoting\""]] or [['it'\''s "quoting"']], fs.Q([[it's "quoting"]])) | ||
| 15 | end) | ||
| 16 | |||
| 17 | it("argument with special characters", function() | ||
| 18 | assert.are.same(is_win and [["\\"%" \\\\" \\\\\\"]] or [['\% \\" \\\']], fs.Q([[\% \\" \\\]])) | ||
| 19 | end) | ||
| 20 | end) | ||
| 21 | end) | ||
