2022-09-19 00:18:48 +00:00
|
|
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
2021-06-26 15:28:39 +00:00
|
|
|
|
|
|
|
describe("Vector3.equals", function()
|
|
|
|
it("should return true when identical", function()
|
|
|
|
local a = Vector3.new(3, 4, 5)
|
|
|
|
local b = Vector3.new(3, 4, 5)
|
|
|
|
|
|
|
|
assert.are.same(
|
|
|
|
true,
|
|
|
|
a:equals(b)
|
|
|
|
)
|
|
|
|
end)
|
|
|
|
it("should return false when not identical", function()
|
|
|
|
local a = Vector3.new(3, 4, 5)
|
|
|
|
local b = Vector3.new(6, 7, 8)
|
|
|
|
|
|
|
|
assert.are.same(
|
|
|
|
false,
|
|
|
|
a:equals(b)
|
|
|
|
)
|
|
|
|
end)
|
|
|
|
it("should return false when not identical x", function()
|
|
|
|
local a = Vector3.new(3, 4, 5)
|
|
|
|
local b = Vector3.new(4, 4, 5)
|
|
|
|
|
|
|
|
assert.are.same(
|
|
|
|
false,
|
|
|
|
a:equals(b)
|
|
|
|
)
|
|
|
|
end)
|
|
|
|
it("should return false when not identical y", function()
|
|
|
|
local a = Vector3.new(3, 4, 5)
|
|
|
|
local b = Vector3.new(3, 5, 5)
|
|
|
|
|
|
|
|
assert.are.same(
|
|
|
|
false,
|
|
|
|
a:equals(b)
|
|
|
|
)
|
|
|
|
end)
|
|
|
|
end)
|