From c6e3556c0a883831dde10858b32ce21cacd1bd0e Mon Sep 17 00:00:00 2001 From: Ignacio BurgueƱo Date: Tue, 30 Jun 2015 12:33:36 -0300 Subject: Strip known extensions --- test/testing.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/testing.lua') diff --git a/test/testing.lua b/test/testing.lua index 50911fd4..63dead2b 100644 --- a/test/testing.lua +++ b/test/testing.lua @@ -441,5 +441,17 @@ local tests = { return run "$luarocks install luarepl" and run "$luarocks doc luarepl" end, + + -- Tests for https://github.com/keplerproject/luarocks/issues/375 + test_fetch_base_dir = function() + local fetch = require "luarocks.fetch" + + return assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3.zip")) + and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.zip")) + and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.gz")) + and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.bz2")) + and assert("parser.moon" == fetch.url_to_base_dir("git://github.com/Cirru/parser.moon")) + and assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3")) + end } -- cgit v1.2.3-55-g6feb