mirror of
https://github.com/TangentFoxy/semver.lua.git
synced 2025-07-28 02:52:21 +00:00
finished with prereleases
This commit is contained in:
@@ -118,7 +118,30 @@ context('semver', function()
|
||||
assert_greater_than(v'0.0.2', v'0.0.1')
|
||||
end)
|
||||
describe("prereleases", function()
|
||||
|
||||
test("false if exact same prerelease", function()
|
||||
assert_false(v'1.0.0-beta' < v'1.0.0-beta')
|
||||
end)
|
||||
test("a prerelease version is less than the official version", function()
|
||||
assert_less_than(v'1.0.0-rc1', v'1.0.0')
|
||||
end)
|
||||
test("identifiers with only digits are compared numerically", function()
|
||||
assert_less_than(v'1.0.0-1', v'1.0.0-2')
|
||||
assert_less_than(v'1.0.0-2', v'1.0.0-10')
|
||||
end)
|
||||
test("itendifiers with letters or dashes are compared lexiconumerically", function()
|
||||
assert_less_than(v'1.0.0-alpha', v'1.0.0-beta')
|
||||
assert_less_than(v'1.0.0-alpha-10', v'1.0.0-alpha-2')
|
||||
end)
|
||||
test("numerical ids always have less priority than lexiconumericals", function()
|
||||
assert_less_than(v'1.0.0-1', v'1.0.0-alpha')
|
||||
assert_less_than(v'1.0.0-2', v'1.0.0-1asdf')
|
||||
end)
|
||||
test("identifiers can be separated by colons; they must be compared individually", function()
|
||||
assert_less_than(v'1.0.0-alpha', v'1.0.0-alpha.1')
|
||||
assert_less_than(v'1.0.0-alpha.1', v'1.0.0-beta.2')
|
||||
assert_less_than(v'1.0.0-beta.2', v'1.0.0-beta.11')
|
||||
assert_less_than(v'1.0.0-beta.11', v'1.0.0-rc.1')
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
|
Reference in New Issue
Block a user