mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-23 12:05:01 +00:00
25 lines
1.4 KiB
Lua
25 lines
1.4 KiB
Lua
|
local parse_seed = require("worldeditadditions_core.utils.parse.seed")
|
||
|
|
||
|
describe("parse.seed", function()
|
||
|
it("should work", function()
|
||
|
local source = "a test string"
|
||
|
|
||
|
local result = parse_seed(source)
|
||
|
|
||
|
assert.are.equal(
|
||
|
"number",
|
||
|
type(result)
|
||
|
)
|
||
|
end)
|
||
|
it("should work with a long string", function()
|
||
|
local source = "If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction. If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction. If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction. If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction. If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction. If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction. If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction. If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction. If it looks like a duck and quacks like a duck but it needs batteries, you probably have the wrong abstraction."
|
||
|
|
||
|
local result = parse_seed(source)
|
||
|
|
||
|
assert.are.equal(
|
||
|
"number",
|
||
|
type(result)
|
||
|
)
|
||
|
end)
|
||
|
end)
|