aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-09-21 13:33:29 -0300
committerHisham Muhammad <hisham@gobolinux.org>2015-09-21 13:33:29 -0300
commita6437041edd32f7981a65b45fccc27ce857c3ff6 (patch)
tree4bc3daf1b21694534d45232f62e886b026c645df /test
parent910fbe111c5f6e7e104604346ce67dbe22d15b27 (diff)
parent5fa1201dd0cb5ee5e29b8ebcb57b265335bbe3e9 (diff)
downloadluarocks-a6437041edd32f7981a65b45fccc27ce857c3ff6.tar.gz
luarocks-a6437041edd32f7981a65b45fccc27ce857c3ff6.tar.bz2
luarocks-a6437041edd32f7981a65b45fccc27ce857c3ff6.zip
Merge branch 'master' into luarocks-3
Diffstat (limited to 'test')
-rw-r--r--test/testing.lua12
-rwxr-xr-xtest/testing.sh13
2 files changed, 25 insertions, 0 deletions
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 = {
441 return run "$luarocks install luarepl" 441 return run "$luarocks install luarepl"
442 and run "$luarocks doc luarepl" 442 and run "$luarocks doc luarepl"
443 end, 443 end,
444
445 -- Tests for https://github.com/keplerproject/luarocks/issues/375
446 test_fetch_base_dir = function()
447 local fetch = require "luarocks.fetch"
448
449 return assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3.zip"))
450 and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.zip"))
451 and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.gz"))
452 and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.bz2"))
453 and assert("parser.moon" == fetch.url_to_base_dir("git://github.com/Cirru/parser.moon"))
454 and assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3"))
455 end
444 456
445} 457}
diff --git a/test/testing.sh b/test/testing.sh
index 49aaa244..df1d301d 100755
--- a/test/testing.sh
+++ b/test/testing.sh
@@ -511,6 +511,19 @@ fail_config_user_config() { LUAROCKS_CONFIG="/missing_file.lua" $luarocks config
511test_config_rock_trees() { $luarocks config --rock-trees; } 511test_config_rock_trees() { $luarocks config --rock-trees; }
512test_config_help() { $luarocks help config; } 512test_config_help() { $luarocks help config; }
513 513
514# Tests for https://github.com/keplerproject/luarocks/issues/375
515test_fetch_base_dir() { $lua <<EOF
516 local fetch = require "luarocks.fetch"
517
518 assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3.zip"))
519 assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.zip"))
520 assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.gz"))
521 assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.bz2"))
522 assert("parser.moon" == fetch.url_to_base_dir("git://github.com/Cirru/parser.moon"))
523 assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3"))
524EOF
525}
526
514test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } 527test_doc() { $luarocks install luarepl; $luarocks doc luarepl; }
515 528
516# Driver ######################################### 529# Driver #########################################