summaryrefslogtreecommitdiff
path: root/tests/modules/devel/git/test.lua
diff options
context:
space:
mode:
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