Files
Hunter/scripts/Tests/Zones.spec.luau
T

10 lines
518 B
Luau

--!strict
return function(zones: any)
local spec = {radius = 18, height = 7, sightHeight = 2}
assert(zones.reason(Vector3.new(18.01, 0, 0), spec, true) == "Outside")
assert(zones.reason(Vector3.new(18, 7, 0), spec, false) == "Inside")
assert(zones.reason(Vector3.new(0, -7.01, 0), spec, false) == "Height")
assert(zones.reason(Vector3.new(0, -7, 0), spec, true) == "Blocked")
assert(zones.reason(Vector3.new(0, 8, 0), {radius = 18, height = 8, sightHeight = 2.7, exclusiveHeight = true}, false) == "Height")
end