From 9fa0bb2822af391db96687ad6ddb66ddb3529c58 Mon Sep 17 00:00:00 2001 From: William Boman Date: Tue, 17 May 2022 13:49:18 +0200 Subject: chore(functional): restructure and extend functional modules (#703) --- tests/core/functional/data_spec.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/core/functional/data_spec.lua (limited to 'tests/core/functional/data_spec.lua') diff --git a/tests/core/functional/data_spec.lua b/tests/core/functional/data_spec.lua new file mode 100644 index 00000000..b89176e2 --- /dev/null +++ b/tests/core/functional/data_spec.lua @@ -0,0 +1,28 @@ +local _ = require "nvim-lsp-installer.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) -- cgit v1.2.3-70-g09d2