mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
refactor: move test directories
This commit is contained in:
parent
0d1e85754a
commit
10521d05c2
35 changed files with 81 additions and 77 deletions
|
|
@ -1,21 +0,0 @@
|
|||
local Charm = require("../../Charm")
|
||||
local test = require("../../../../tests/test")
|
||||
local utils = require("../utils")
|
||||
|
||||
test("should flatten functions", function()
|
||||
local input = {
|
||||
a = Charm.atom(0),
|
||||
b = { c = Charm.atom(0) },
|
||||
d = { e = { f = utils.signalToAtom(Charm.signal(0)) } },
|
||||
}
|
||||
local result = utils.flatten(input)
|
||||
|
||||
assert(result.a == input.a, "should flatten the first level")
|
||||
assert(result["b/c"] == input.b.c, "should flatten the second level")
|
||||
assert(result["d/e/f"] == input.d.e.f, "should flatten the third level")
|
||||
|
||||
assert(result.b == nil, "should remove the original nested tables")
|
||||
assert(result.d == nil, "should remove the original nested tables")
|
||||
end)
|
||||
|
||||
return {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue