2022-09-19 00:18:48 +00:00
|
|
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
2021-06-26 13:10:28 +00:00
|
|
|
|
|
|
|
describe("Vector3.add", function()
|
|
|
|
it("should create a new Vector3", function()
|
|
|
|
assert.are.same(
|
2021-06-26 13:40:14 +00:00
|
|
|
{ x = 3, y = 4, z = 5 },
|
|
|
|
Vector3.new(3, 4, 5)
|
2021-06-26 13:10:28 +00:00
|
|
|
)
|
|
|
|
end)
|
2021-08-04 20:24:36 +00:00
|
|
|
it("should default to (0, 0, 0)", function()
|
|
|
|
assert.are.same(
|
|
|
|
{ x = 0, y = 0, z = 0 },
|
|
|
|
Vector3.new()
|
|
|
|
)
|
|
|
|
end)
|
2021-07-15 01:19:42 +00:00
|
|
|
it("should not throw an error on invalid x", function()
|
|
|
|
assert.has_no.errors(function()
|
2021-06-26 13:10:28 +00:00
|
|
|
Vector3.new("cheese", 4, 5)
|
|
|
|
end)
|
|
|
|
end)
|
2021-07-15 01:19:42 +00:00
|
|
|
it("should not throw an error on invalid y", function()
|
|
|
|
assert.has_no.errors(function()
|
2021-06-26 13:10:28 +00:00
|
|
|
Vector3.new(4, "cheese", 5)
|
|
|
|
end)
|
|
|
|
end)
|
2021-07-15 01:19:42 +00:00
|
|
|
it("should not throw an error on invalid z", function()
|
|
|
|
assert.has_no.errors(function()
|
2021-06-26 13:10:28 +00:00
|
|
|
Vector3.new(66, 2, "cheese")
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|