diff options
| author | OpportunityLiu <[email protected]> | 2019-06-05 14:18:10 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-06-06 14:37:22 +0800 |
| commit | e9b11611ea2c2c2c892938deee37797a5d10d296 (patch) | |
| tree | 1fd47b9747bf6db535ed817636ba6bf1481037d1 /tests/modules/devel/git/test.lua | |
| parent | 12671e1c0af4e86d1ee73ccd13ff35defde7dc4b (diff) | |
install script
Diffstat (limited to 'tests/modules/devel/git/test.lua')
| -rw-r--r-- | tests/modules/devel/git/test.lua | 21 |
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 |
