Skip to content

Commit cf3970b

Browse files
committed
test: 🔧 added Package.lua
1 parent 1c67fe0 commit cf3970b

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

package.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
local spath =
2+
debug.getinfo(1,'S').source:sub(2):gsub("/+", "/"):gsub("[^/]*$","")
3+
package.path = spath.."?.lua;"
4+
..spath.."ccClass/?.lua;"
5+
..spath.."fs/?.lua;"
6+
..spath.."helperFunctions/?.lua;"
7+
..spath.."http/?.lua;"
8+
..spath.."json/?.lua;"
9+
..spath.."vector/?.lua;"
10+
..package.path

vector/tests/test_spec.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

2-
local vPath = debug.getinfo(1).source:match("@?(.*/)")
3-
vPath = string.gsub(vPath, "/tests", "") .. "vector"
4-
local vector = require(vPath)
2+
local spath =
3+
debug.getinfo(1,'S').source:sub(2):gsub("/+", "/"):gsub("[^/]*$",""):gsub("/vector/tests", ""):gsub("vector/tests", "")
4+
if spath == "" then
5+
spath = "./"
6+
end
7+
require(spath .. "package")
8+
local vector = require("vector")
59

610
describe('Vector', function()
711
it('should create a new vector', function()

0 commit comments

Comments
 (0)