aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2015-07-01 23:14:34 +0200
committerThijs Schreijer <thijs@thijsschreijer.nl>2015-07-01 23:14:34 +0200
commit6ca144cee96ef45d6a203455b236e4077dd37a03 (patch)
tree54b21f2b46291f64dfca4c9ae36928819053a693 /test
parent642be5cee59a20654226466f6f865e230c326751 (diff)
parent634ff0af63a250859863cee25b8ab21e2404a267 (diff)
downloadluarocks-6ca144cee96ef45d6a203455b236e4077dd37a03.tar.gz
luarocks-6ca144cee96ef45d6a203455b236e4077dd37a03.tar.bz2
luarocks-6ca144cee96ef45d6a203455b236e4077dd37a03.zip
Merge branch 'master' of github.com:keplerproject/luarocks into pref_versioned
Conflicts: src/luarocks/cfg.lua
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 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
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 #########################################