diff --git a/spec/gears/table_spec.lua b/spec/gears/table_spec.lua index 5b69ba0b..1c69f4fd 100644 --- a/spec/gears/table_spec.lua +++ b/spec/gears/table_spec.lua @@ -42,6 +42,27 @@ describe("gears.table", function() end) end) + describe("table.find_keys", function() + it("nil argument", function() + local t = { "a", "b", c = "c", "d" } + local f = gtable.find_keys(t, function(k) return k == "c" end) + assert.is.same(f, {"c"}) + end) + end) + + describe("table.hasitem", function() + it("exist", function() + local t = {"a", "b", c = "c"} + local f = gtable.hasitem(t, "c") + assert.is.equal(f, "c") + end) + it("nil", function() + local t = {"a", "b"} + local f = gtable.hasitem(t, "c") + assert.is.equal(f, nil) + end) + end) + describe("table.join", function() it("nil argument", function() local t = gtable.join({"a"}, nil, {"b"})