1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
local _ = require "mason-core.functional"
describe("functional: data", function()
it("creates enums", function()
local colors = _.enum {
"BLUE",
"YELLOW",
}
assert.same({
["BLUE"] = "BLUE",
["YELLOW"] = "YELLOW",
}, colors)
end)
it("creates sets", function()
local colors = _.set_of {
"BLUE",
"YELLOW",
"BLUE",
"RED",
}
assert.same({
["BLUE"] = true,
["YELLOW"] = true,
["RED"] = true,
}, colors)
end)
end)
|