mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-08-21 14:04:06 +02:00
Update tests to wea_c
This commit is contained in:
parent
2af1226b49
commit
1ae36d3898
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.abs", function()
|
describe("Vector3.abs", function()
|
||||||
it("should work with a positive vector", function()
|
it("should work with a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.add", function()
|
describe("Vector3.add", function()
|
||||||
it("should add 2 positive vectors", function()
|
it("should add 2 positive vectors", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.area", function()
|
describe("Vector3.area", function()
|
||||||
it("should work with a positive vector", function()
|
it("should work with a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.ceil", function()
|
describe("Vector3.ceil", function()
|
||||||
it("should ceil a positive vector", function()
|
it("should ceil a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.clamp", function()
|
describe("Vector3.clamp", function()
|
||||||
it("should work by not changing values if it's already clamped", function()
|
it("should work by not changing values if it's already clamped", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.clone", function()
|
describe("Vector3.clone", function()
|
||||||
it("should return a new Vector3 instance", function()
|
it("should return a new Vector3 instance", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.__concat", function()
|
describe("Vector3.__concat", function()
|
||||||
it("should work when concatenating a Vector3 + Vector3", function()
|
it("should work when concatenating a Vector3 + Vector3", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.divide", function()
|
describe("Vector3.divide", function()
|
||||||
it("should divide 2 positive vectors", function()
|
it("should divide 2 positive vectors", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.dot", function()
|
describe("Vector3.dot", function()
|
||||||
it("should work with a positive vector", function()
|
it("should work with a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.equals", function()
|
describe("Vector3.equals", function()
|
||||||
it("should return true when identical", function()
|
it("should return true when identical", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.expand_region", function()
|
describe("Vector3.expand_region", function()
|
||||||
it("should work with positive vectors", function()
|
it("should work with positive vectors", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.floor", function()
|
describe("Vector3.floor", function()
|
||||||
it("should floor a positive vector", function()
|
it("should floor a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.is_contained", function()
|
describe("Vector3.is_contained", function()
|
||||||
it("should return true when inside", function()
|
it("should return true when inside", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
-- To find these numbers, in Javascript:
|
-- To find these numbers, in Javascript:
|
||||||
-- function t(x) { return Math.sqrt((x*x)*3); }
|
-- function t(x) { return Math.sqrt((x*x)*3); }
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.length_squared", function()
|
describe("Vector3.length_squared", function()
|
||||||
it("should work with a positive vector", function()
|
it("should work with a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.limit_to", function()
|
describe("Vector3.limit_to", function()
|
||||||
it("should limit_to a positive vector", function()
|
it("should limit_to a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.max", function()
|
describe("Vector3.max", function()
|
||||||
it("should work with positive vectors", function()
|
it("should work with positive vectors", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.max_component", function()
|
describe("Vector3.max_component", function()
|
||||||
it("should work with a positive vector x", function()
|
it("should work with a positive vector x", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.mean", function()
|
describe("Vector3.mean", function()
|
||||||
it("should work with a positive vector", function()
|
it("should work with a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.min", function()
|
describe("Vector3.min", function()
|
||||||
it("should work with positive vectors", function()
|
it("should work with positive vectors", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.min_component", function()
|
describe("Vector3.min_component", function()
|
||||||
it("should work with a positive vector x", function()
|
it("should work with a positive vector x", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
-- To find these numbers, in Javascript:
|
-- To find these numbers, in Javascript:
|
||||||
-- function t(x) { return Math.sqrt((x*x)*3); }
|
-- function t(x) { return Math.sqrt((x*x)*3); }
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.multiply", function()
|
describe("Vector3.multiply", function()
|
||||||
it("should multiply 2 positive vectors", function()
|
it("should multiply 2 positive vectors", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.add", function()
|
describe("Vector3.add", function()
|
||||||
it("should create a new Vector3", function()
|
it("should create a new Vector3", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.round", function()
|
describe("Vector3.round", function()
|
||||||
it("should round a positive vector", function()
|
it("should round a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.set_to", function()
|
describe("Vector3.set_to", function()
|
||||||
it("should set_to a positive vector", function()
|
it("should set_to a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.snap_to", function()
|
describe("Vector3.snap_to", function()
|
||||||
it("should snap_to a positive vector", function()
|
it("should snap_to a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.sort", function()
|
describe("Vector3.sort", function()
|
||||||
it("should work with positive vectors", function()
|
it("should work with positive vectors", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.sqrt", function()
|
describe("Vector3.sqrt", function()
|
||||||
it("should sqrt a positive vector", function()
|
it("should sqrt a positive vector", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.subtract", function()
|
describe("Vector3.subtract", function()
|
||||||
it("should subtract 2 positive vectors", function()
|
it("should subtract 2 positive vectors", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
describe("Vector3.__tostring", function()
|
describe("Vector3.__tostring", function()
|
||||||
it("should stringify a Vector3", function()
|
it("should stringify a Vector3", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
-- To find these numbers, in Javascript:
|
-- To find these numbers, in Javascript:
|
||||||
-- function t(x) { return Math.sqrt((x*x)*3); }
|
-- function t(x) { return Math.sqrt((x*x)*3); }
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
local facing_dirs = dofile("./.tests/parse/axes/include_facing_dirs.lua")
|
local facing_dirs = dofile("./.tests/parse/axes/include_facing_dirs.lua")
|
||||||
|
|
||||||
local parse = require("worldeditadditions.utils.parse.axes_parser")
|
local parse = require("worldeditadditions_core.utils.parse.axes_parser")
|
||||||
local parse_axes = parse.keytable
|
local parse_axes = parse.keytable
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
local axes = require("worldeditadditions.utils.parse.axes")
|
local axes = require("worldeditadditions.utils.parse.axes")
|
||||||
local parse_abs_axis_name = axes.parse_abs_axis_name
|
local parse_abs_axis_name = axes.parse_abs_axis_name
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
local facing_dirs = dofile("./.tests/parse/axes/include_facing_dirs.lua")
|
local facing_dirs = dofile("./.tests/parse/axes/include_facing_dirs.lua")
|
||||||
|
|
||||||
local axes = require("worldeditadditions.utils.parse.axes")
|
local axes = require("worldeditadditions_core.utils.parse.axes")
|
||||||
local parse_axes = axes.parse_axes
|
local parse_axes = axes.parse_axes
|
||||||
|
|
||||||
--[[ Original idea for how this function was supposed to work from @VorTechnix
|
--[[ Original idea for how this function was supposed to work from @VorTechnix
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
local Vector3 = require("worldeditadditions.utils.vector3")
|
local Vector3 = require("worldeditadditions_core.utils.vector3")
|
||||||
|
|
||||||
local facing_dirs = dofile("./.tests/parse/axes/include_facing_dirs.lua")
|
local facing_dirs = dofile("./.tests/parse/axes/include_facing_dirs.lua")
|
||||||
|
|
||||||
local axes = require("worldeditadditions.utils.parse.axes")
|
local axes = require("worldeditadditions_core.utils.parse.axes")
|
||||||
local parse_relative_axis_name = axes.parse_relative_axis_name
|
local parse_relative_axis_name = axes.parse_relative_axis_name
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local polyfill = require("worldeditadditions.utils.strings.polyfill")
|
local polyfill = require("worldeditadditions_core.utils.strings.polyfill")
|
||||||
|
|
||||||
describe("str_ends", function()
|
describe("str_ends", function()
|
||||||
it("should return true for a single character", function()
|
it("should return true for a single character", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local polyfill = require("worldeditadditions.utils.strings.polyfill")
|
local polyfill = require("worldeditadditions_core.utils.strings.polyfill")
|
||||||
|
|
||||||
describe("str_padend", function()
|
describe("str_padend", function()
|
||||||
it("should pad a string", function()
|
it("should pad a string", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local polyfill = require("worldeditadditions.utils.strings.polyfill")
|
local polyfill = require("worldeditadditions_core.utils.strings.polyfill")
|
||||||
|
|
||||||
describe("str_padstart", function()
|
describe("str_padstart", function()
|
||||||
it("should pad a string", function()
|
it("should pad a string", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local polyfill = require("worldeditadditions.utils.strings.polyfill")
|
local polyfill = require("worldeditadditions_core.utils.strings.polyfill")
|
||||||
|
|
||||||
describe("str_starts", function()
|
describe("str_starts", function()
|
||||||
it("should return true for a single character", function()
|
it("should return true for a single character", function()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local polyfill = require("worldeditadditions.utils.strings.polyfill")
|
local polyfill = require("worldeditadditions_core.utils.strings.polyfill")
|
||||||
|
|
||||||
describe("trim", function()
|
describe("trim", function()
|
||||||
it("work for a string that's already trimmed", function()
|
it("work for a string that's already trimmed", function()
|
||||||
|
Loading…
Reference in New Issue
Block a user