aboutsummaryrefslogtreecommitdiffstats
path: root/tests/core/functional/relation_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/functional/relation_spec.lua')
-rw-r--r--tests/core/functional/relation_spec.lua36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/core/functional/relation_spec.lua b/tests/core/functional/relation_spec.lua
deleted file mode 100644
index 4c92ffb5..00000000
--- a/tests/core/functional/relation_spec.lua
+++ /dev/null
@@ -1,36 +0,0 @@
-local _ = require "mason.core.functional"
-
-describe("functional: relation", function()
- it("should check equality", function()
- local tbl = {}
- local is_tbl = _.equals(tbl)
- local is_a = _.equals "a"
- local is_42 = _.equals(42)
-
- assert.is_true(is_tbl(tbl))
- assert.is_true(is_a "a")
- assert.is_true(is_42(42))
- assert.is_false(is_a "b")
- assert.is_false(is_42(32))
- end)
-
- it("should check property equality", function()
- local fn_key = function() end
- local tbl = { a = "a", b = "b", number = 42, [fn_key] = "fun" }
- assert.is_true(_.prop_eq("a", "a", tbl))
- assert.is_true(_.prop_eq(fn_key, "fun", tbl))
- assert.is_true(_.prop_eq(fn_key) "fun"(tbl))
- end)
-
- it("should check whether property satisfies predicate", function()
- local obj = {
- low = 0,
- med = 10,
- high = 15,
- }
-
- assert.is_false(_.prop_satisfies(_.gt(10), "low", obj))
- assert.is_false(_.prop_satisfies(_.gt(10), "med")(obj))
- assert.is_true(_.prop_satisfies(_.gt(10)) "high"(obj))
- end)
-end)