remove gcc for MacOS in conan.yml
[liba.git] / lua / test / trajbell.lua
blob5c98ebfc82190cb513007670b9783ac27ef37991
1 #!/usr/bin/env lua
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.trajbell))
8 local ctx = a.trajbell.new()
9 assert(ctx)
10 test.dir(getmetatable(ctx))
11 assert(a.trajbell.gen(ctx, 3, 2, 3, 0, 10) > 0)
12 assert(type(a.trajbell.pos(ctx, 0.5)) == "number")
13 assert(type(a.trajbell.vel(ctx, 0.5)) == "number")
14 assert(type(a.trajbell.acc(ctx, 0.5)) == "number")
15 assert(type(a.trajbell.jer(ctx, 0.5)) == "number")
16 assert(ctx.gen(ctx, 3, 2, 3, 0, 10) > 0)
17 assert(type(ctx.pos(ctx, 0.5)) == "number")
18 assert(type(ctx.vel(ctx, 0.5)) == "number")
19 assert(type(ctx.acc(ctx, 0.5)) == "number")
20 assert(type(ctx.jer(ctx, 0.5)) == "number")
21 assert(ctx:gen(3, 2, 3, 0, 10) > 0)
22 assert(type(ctx:pos(0.5)) == "number")
23 assert(type(ctx:vel(0.5)) == "number")
24 assert(type(ctx:acc(0.5)) == "number")
25 assert(type(ctx:jer(0.5)) == "number")
26 assert(type(ctx.t) == "number")
27 assert(type(ctx.tv) == "number")
28 assert(type(ctx.ta) == "number")
29 assert(type(ctx.td) == "number")
30 assert(type(ctx.taj) == "number")
31 assert(type(ctx.tdj) == "number")
32 assert(type(ctx.p0) == "number")
33 assert(type(ctx.p1) == "number")
34 assert(type(ctx.v0) == "number")
35 assert(type(ctx.v1) == "number")
36 assert(type(ctx.vm) == "number")
37 assert(type(ctx.jm) == "number")
38 assert(type(ctx.am) == "number")
39 assert(type(ctx.dm) == "number")
40 ctx.__name = nil
41 assert(ctx.__name)
42 ctx.__index = nil
43 assert(ctx.__index)
44 ctx.__newindex = nil
45 assert(ctx.__newindex)
46 ---@class a.trajbell
47 ---@field __name string
48 ---@field __index table
49 ---@field __newindex table