aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIgnacio Burgueño <ignaciob@inconcertcc.com>2015-06-30 12:33:36 -0300
committerIgnacio Burgueño <ignaciob@inconcertcc.com>2015-06-30 12:33:36 -0300
commitc6e3556c0a883831dde10858b32ce21cacd1bd0e (patch)
tree249fc65fc70a709e5fb0223eb62f699f56f7f3a0 /test
parent066e1c6bd90d2e0e4fcdbc116bd857c62779b4cd (diff)
downloadluarocks-c6e3556c0a883831dde10858b32ce21cacd1bd0e.tar.gz
luarocks-c6e3556c0a883831dde10858b32ce21cacd1bd0e.tar.bz2
luarocks-c6e3556c0a883831dde10858b32ce21cacd1bd0e.zip
Strip known extensions
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 #########################################