mirror of
https://github.com/0x5eal/semver-luau.git
synced 2024-12-13 16:50:35 +00:00
chore(tests): migrate parse_valid to use official frktest package
Also removes `any` casts since https://github.com/itsfrank/frktest/issues/2 was resolved.
This commit is contained in:
parent
7311c439e3
commit
fc9a8701f6
1 changed files with 51 additions and 54 deletions
|
@ -1,4 +1,4 @@
|
||||||
local frktest = require("../lune_packages/frktest").core
|
local frktest = require("@pkg/frktest")
|
||||||
local test = frktest.test
|
local test = frktest.test
|
||||||
local check = frktest.assert.check
|
local check = frktest.assert.check
|
||||||
|
|
||||||
|
@ -7,9 +7,6 @@ type Option<T> = Option.Option<T>
|
||||||
|
|
||||||
local Semver = require("../lib")
|
local Semver = require("../lib")
|
||||||
|
|
||||||
-- FIXME: Any casts all over the place, because of frktest not being correctly typed
|
|
||||||
-- See https://github.com/itsfrank/frktest/issues/2
|
|
||||||
|
|
||||||
return function()
|
return function()
|
||||||
test.suite("Basic tests", function()
|
test.suite("Basic tests", function()
|
||||||
test.case("Semver creates valid version objects", function()
|
test.case("Semver creates valid version objects", function()
|
||||||
|
@ -32,11 +29,11 @@ return function()
|
||||||
check.equal(version.patch, 3)
|
check.equal(version.patch, 3)
|
||||||
|
|
||||||
check.table.equal(
|
check.table.equal(
|
||||||
version.prerelease :: any,
|
version.prerelease,
|
||||||
Option.Some({
|
Option.Some({
|
||||||
type = "beta",
|
type = "beta",
|
||||||
ordinal = Option.Some(1),
|
ordinal = Option.Some(1),
|
||||||
}) :: any
|
})
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -49,7 +46,7 @@ return function()
|
||||||
check.equal(version.major, 1)
|
check.equal(version.major, 1)
|
||||||
check.equal(version.minor, 2)
|
check.equal(version.minor, 2)
|
||||||
check.equal(version.patch, 3)
|
check.equal(version.patch, 3)
|
||||||
check.table.equal(version.buildMetadata :: any, Option.Some("build.123") :: any)
|
check.table.equal(version.buildMetadata, Option.Some("build.123"))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
test.case("Semver handles prerelease versions with build metadata", function()
|
test.case("Semver handles prerelease versions with build metadata", function()
|
||||||
|
@ -62,14 +59,14 @@ return function()
|
||||||
check.equal(version.patch, 3)
|
check.equal(version.patch, 3)
|
||||||
|
|
||||||
check.table.equal(
|
check.table.equal(
|
||||||
version.prerelease :: any,
|
version.prerelease,
|
||||||
Option.Some({
|
Option.Some({
|
||||||
type = "beta",
|
type = "beta",
|
||||||
ordinal = Option.Some(1),
|
ordinal = Option.Some(1),
|
||||||
}) :: any
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
check.table.equal(version.buildMetadata :: any, Option.Some("build.123") :: any)
|
check.table.equal(version.buildMetadata, Option.Some("build.123"))
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue