aboutsummaryrefslogtreecommitdiff
path: root/builtin/common/tests
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2020-08-29 17:41:29 +0200
committerGitHub <noreply@github.com>2020-08-29 16:41:29 +0100
commit28e87ce9d5fdf163c1eb0daf83279e949f84765d (patch)
treeabf144b7c8e5ee21c5dfbd16495a70e3475a056e /builtin/common/tests
parent9976f36b18b8d227e3240feb24000dda0916ee44 (diff)
downloadminetest-28e87ce9d5fdf163c1eb0daf83279e949f84765d.tar.gz
minetest-28e87ce9d5fdf163c1eb0daf83279e949f84765d.tar.bz2
minetest-28e87ce9d5fdf163c1eb0daf83279e949f84765d.zip
Add vector.offset (#10321)
Diffstat (limited to 'builtin/common/tests')
-rw-r--r--builtin/common/tests/vector_spec.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/common/tests/vector_spec.lua b/builtin/common/tests/vector_spec.lua
index 6f308a4a8..0f287363a 100644
--- a/builtin/common/tests/vector_spec.lua
+++ b/builtin/common/tests/vector_spec.lua
@@ -44,6 +44,10 @@ describe("vector", function()
assert.same({ x = 2, y = 4, z = 6 }, vector.add(vector.new(1, 2, 3), { x = 1, y = 2, z = 3 }))
end)
+ it("offset()", function()
+ assert.same({ x = 41, y = 52, z = 63 }, vector.offset(vector.new(1, 2, 3), 40, 50, 60))
+ end)
+
-- This function is needed because of floating point imprecision.
local function almost_equal(a, b)
if type(a) == "number" then