diff options
| author | OpportunityLiu <[email protected]> | 2019-06-08 13:34:02 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-06-08 13:34:02 +0800 |
| commit | 1af88102687e493cab40e62b0a2b8b7d42417ae6 (patch) | |
| tree | 272a80b424e68024a9ecda138159864d9659fe5a /tests/modules/devel/git/test.lua | |
| parent | e165a8e43abed4eb2eca64c3b5adefb57cd65600 (diff) | |
improve test lib
Diffstat (limited to 'tests/modules/devel/git/test.lua')
| -rw-r--r-- | tests/modules/devel/git/test.lua | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/tests/modules/devel/git/test.lua b/tests/modules/devel/git/test.lua index ddcfc94b2..0fbae4b1e 100644 --- a/tests/modules/devel/git/test.lua +++ b/tests/modules/devel/git/test.lua @@ -1,21 +1,17 @@ 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") +function test_asgiturl(t) + t:are_equal(git.asgiturl("http://github.com/a/b"), "https://github.com/a/b.git") + t:are_equal(git.asgiturl("http://github.com/a/b/"), "https://github.com/a/b.git") + t:are_equal(git.asgiturl("HTTP://github.com//a/b/"), "https://github.com/a/b.git") + t:are_equal(git.asgiturl("http://github.com//a/b/s"), nil) + t:are_equal(git.asgiturl("https://github.com/a/b"), "https://github.com/a/b.git") + t:are_equal(git.asgiturl("https://github.com/a/b.git"), "https://github.com/a/b.git") + t:are_equal(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() + t:are_equal(git.asgiturl("github:a/b"), "https://github.com/a/b.git") + t:are_equal(git.asgiturl("github:a/b.git"), "https://github.com/a/b.git.git") + t:are_equal(git.asgiturl("GitHub://a/b/"), "https://github.com/a/b.git") + t:are_equal(git.asgiturl("github:a/b/c"), nil) end
\ No newline at end of file |
