Skip to content
ChristophLHR edited this page Jul 4, 2024 · 2 revisions

vectorTest-lib

CC comes with a Vector Type, which needs to be emulated to test programms utilizing it. To use it in a testing env. like busted:

-- this needs to be GLOBAL, to take effect in the script you are trying to test
-- in CC, "vector" is a global name
vector = require('.vector.lua')

local vectorOne = vector.new(1, 2, 3)

--...

The script should then handle the vector just like the CC Documentation describes.

Requirements

  • a script simulating lua "Classes & instances"
    • SCM, which will load the script as needed
    • or SimpleLuaClasses from lua-users - named: ccClass.lua in ./libs folder
Clone this wiki locally