mirror of
https://github.com/TangentFoxy/semver.lua.git
synced 2025-07-28 02:52:21 +00:00
Fix #6 Pre-1.0 upgrades should not be safe
This commit is contained in:
@@ -254,6 +254,8 @@ describe('semver', function()
|
||||
describe("^", function()
|
||||
it("true for self", function()
|
||||
assert.is_true(v(1,2,3) ^ v(1,2,3))
|
||||
assert.is_true(v(0,1,0) ^ v(0,1,0))
|
||||
assert.is_true(v("0.1.1+build0") ^ v(0,1,1))
|
||||
end)
|
||||
it("different major versions mean it's always unsafe", function()
|
||||
assert.is_false(v(2,0,0) ^ v(3,0,0))
|
||||
@@ -273,6 +275,15 @@ describe('semver', function()
|
||||
it("is unsafe to downgrade to an earlier minor version", function()
|
||||
assert.is_false(v(1,5,0) ^ v(1,2,0))
|
||||
end)
|
||||
|
||||
it("is unsafe to upgrade any pre-1.0 versions", function()
|
||||
assert.is_false(v("0.0.1-alpha") ^ v(0,0,1))
|
||||
assert.is_false(v("0.0.1") ^ v(0,0,2))
|
||||
assert.is_false(v("0.0.1+build0") ^ v(0,0,2))
|
||||
assert.is_false(v(0,0,1) ^ v(0,1,0))
|
||||
assert.is_false(v(0,0,1) ^ v(1,0,0))
|
||||
assert.is_false(v(0,0,1) ^ v("1.0.0-alpha"))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe("_VERSION", function()
|
||||
|
Reference in New Issue
Block a user