3 ---@diagnostic disable: redefined-local
4 package
.path
= arg
[0]:sub(0, -arg
[0]:match("([^/\\]*)$"):len() - 1) .. "?.lua;" .. package
.path
5 local test
= require("test")
6 local a
= require("liba")
7 test
.dir(getmetatable(a
.lpf
))
8 local ctx
= a
.lpf
.new(0.1)
10 local ctx
= a
.lpf
.new(10, 0.01)
12 test
.dir(getmetatable(ctx
))
13 assert(type(a
.lpf
.gen(ctx
, 10, 0.01)) == "userdata")
14 assert(type(a
.lpf
.gen(ctx
, 0.1)) == "userdata")
15 assert(type(a
.lpf
.iter(ctx
, 1)) == "number")
16 assert(type(a
.lpf
.zero(ctx
)) == "userdata")
17 assert(type(ctx
.gen(ctx
, 10, 0.01)) == "userdata")
18 assert(type(ctx
.gen(ctx
, 0.1)) == "userdata")
19 assert(type(ctx
.iter(ctx
, 1)) == "number")
20 assert(type(ctx
.zero(ctx
)) == "userdata")
21 assert(type(ctx
:gen(10, 0.01)) == "userdata")
22 assert(type(ctx
:gen(0.1)) == "userdata")
23 assert(type(ctx
:iter(1)) == "number")
24 assert(type(ctx
:zero()) == "userdata")
25 assert(type(ctx
.alpha
) == "number")
26 assert(type(ctx
.output
) == "number")
34 assert(ctx
.__newindex
)
36 ---@field __name string
37 ---@field __call function
38 ---@field __index table
39 ---@field __newindex table