diff options
author | DS <vorunbekannt75@web.de> | 2021-06-04 21:22:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-04 21:22:33 +0200 |
commit | 8f085e02a107dd8092393935bfa1bba71d2546d2 (patch) | |
tree | 977942563431784d65b5f5066d04669d522600e6 /builtin/common/tests/misc_helpers_spec.lua | |
parent | e15cae9fa0f99f597f349a7ba07d149cd91cc2d8 (diff) | |
download | minetest-8f085e02a107dd8092393935bfa1bba71d2546d2.tar.gz minetest-8f085e02a107dd8092393935bfa1bba71d2546d2.tar.bz2 minetest-8f085e02a107dd8092393935bfa1bba71d2546d2.zip |
Add metatables to lua vectors (#11039)
Add backwards-compatible metatable functions for vectors.
Diffstat (limited to 'builtin/common/tests/misc_helpers_spec.lua')
-rw-r--r-- | builtin/common/tests/misc_helpers_spec.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/common/tests/misc_helpers_spec.lua b/builtin/common/tests/misc_helpers_spec.lua index bb9d13e7f..b16987f0b 100644 --- a/builtin/common/tests/misc_helpers_spec.lua +++ b/builtin/common/tests/misc_helpers_spec.lua @@ -1,4 +1,5 @@ _G.core = {} +dofile("builtin/common/vector.lua") dofile("builtin/common/misc_helpers.lua") describe("string", function() @@ -55,8 +56,8 @@ end) describe("pos", function() it("from string", function() - assert.same({ x = 10, y = 5.1, z = -2}, core.string_to_pos("10.0, 5.1, -2")) - assert.same({ x = 10, y = 5.1, z = -2}, core.string_to_pos("( 10.0, 5.1, -2)")) + assert.equal(vector.new(10, 5.1, -2), core.string_to_pos("10.0, 5.1, -2")) + assert.equal(vector.new(10, 5.1, -2), core.string_to_pos("( 10.0, 5.1, -2)")) assert.is_nil(core.string_to_pos("asd, 5, -2)")) end) |