diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-20 23:44:27 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-22 10:33:10 -0300 |
| commit | dcaca50d670b3f5654c109339b6f37c766558eb1 (patch) | |
| tree | 638faf5df7570aa874bafdb4179d00f18f410bac /spec/dir_spec.lua | |
| parent | fbd857e1a0b2aae5beb3875427612e41bf67b35e (diff) | |
| download | luarocks-dcaca50d670b3f5654c109339b6f37c766558eb1.tar.gz luarocks-dcaca50d670b3f5654c109339b6f37c766558eb1.tar.bz2 luarocks-dcaca50d670b3f5654c109339b6f37c766558eb1.zip | |
fix: pack: rockspec with a bare file in the url
Diffstat (limited to 'spec/dir_spec.lua')
| -rw-r--r-- | spec/dir_spec.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/dir_spec.lua b/spec/dir_spec.lua index 1b568c8f..9f05c664 100644 --- a/spec/dir_spec.lua +++ b/spec/dir_spec.lua | |||
| @@ -46,8 +46,18 @@ describe("luarocks.dir #unit", function() | |||
| 46 | describe("dir.normalize", function() | 46 | describe("dir.normalize", function() |
| 47 | it("converts backslashes and removes trailing slashes", function() | 47 | it("converts backslashes and removes trailing slashes", function() |
| 48 | assert.are.same("/foo/ovo", dir.normalize("\\foo\\ovo\\")) | 48 | assert.are.same("/foo/ovo", dir.normalize("\\foo\\ovo\\")) |
| 49 | assert.are.same("c:/some/dir", dir.normalize("c:\\..\\some\\foo\\..\\dir")) | ||
| 49 | assert.are.same("http://example.com/foo/ovo", dir.normalize("http://example.com/foo\\ovo\\")) | 50 | assert.are.same("http://example.com/foo/ovo", dir.normalize("http://example.com/foo\\ovo\\")) |
| 50 | end) | 51 | end) |
| 52 | it("strips unneeded /../ and /./", function() | ||
| 53 | assert.are.same("/some/dir/file.txt", dir.normalize("/../../../some/./foo/bar/.././../dir/bla/../file.txt")) | ||
| 54 | assert.are.same("/some/dir/file.txt", dir.normalize("/../../../some/./foo/bar/.././../dir/bla/../file.txt")) | ||
| 55 | end) | ||
| 56 | it("respects relative paths", function() | ||
| 57 | assert.are.same("boo", dir.normalize("./boo")) | ||
| 58 | assert.are.same("/boo", dir.normalize("/./boo")) | ||
| 59 | assert.are.same("../../../../boo", dir.normalize("../../../hello/world/../../../boo")) | ||
| 60 | end) | ||
| 51 | end) | 61 | end) |
| 52 | 62 | ||
| 53 | end) | 63 | end) |
