summaryrefslogtreecommitdiff
path: root/tests/modules/devel/git/test.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-05 14:18:10 +0800
committerOpportunityLiu <[email protected]>2019-06-06 14:37:22 +0800
commite9b11611ea2c2c2c892938deee37797a5d10d296 (patch)
tree1fd47b9747bf6db535ed817636ba6bf1481037d1 /tests/modules/devel/git/test.lua
parent12671e1c0af4e86d1ee73ccd13ff35defde7dc4b (diff)
install script
Diffstat (limited to 'tests/modules/devel/git/test.lua')
-rw-r--r--tests/modules/devel/git/test.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/modules/devel/git/test.lua b/tests/modules/devel/git/test.lua
new file mode 100644
index 000000000..ddcfc94b2
--- /dev/null
+++ b/tests/modules/devel/git/test.lua
@@ -0,0 +1,21 @@
+import("devel.git")
+
+
+function test_asgiturl()
+ assert(git.asgiturl("http://github.com/a/b") == "https://github.com/a/b.git")
+ assert(git.asgiturl("http://github.com/a/b/") == "https://github.com/a/b.git")
+ assert(git.asgiturl("HTTP://github.com//a/b/") == "https://github.com/a/b.git")
+ assert(git.asgiturl("http://github.com//a/b/s") == nil)
+ assert(git.asgiturl("https://github.com/a/b") == "https://github.com/a/b.git")
+ assert(git.asgiturl("https://github.com/a/b.git") == "https://github.com/a/b.git")
+ assert(git.asgiturl("HTTPS://GITHUB.com/a/b.git.git") == "https://github.com/a/b.git.git")
+
+ assert(git.asgiturl("github:a/b") == "https://github.com/a/b.git")
+ assert(git.asgiturl("github:a/b.git") == "https://github.com/a/b.git.git")
+ assert(git.asgiturl("GitHub://a/b/") == "https://github.com/a/b.git")
+ assert(git.asgiturl("github:a/b/c") == nil)
+end
+
+function main()
+ test_asgiturl()
+end \ No newline at end of file