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 ++++++++++++ test/testing.sh | 13 +++++++++++++ 2 files changed, 25 insertions(+) (limited to 'test') 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 } diff --git a/test/testing.sh b/test/testing.sh index 133597ee..6219a38f 100755 --- a/test/testing.sh +++ b/test/testing.sh @@ -511,6 +511,19 @@ fail_config_user_config() { LUAROCKS_CONFIG="/missing_file.lua" $luarocks config test_config_rock_trees() { $luarocks config --rock-trees; } test_config_help() { $luarocks help config; } +# Tests for https://github.com/keplerproject/luarocks/issues/375 +test_fetch_base_dir() { $lua <