diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/mason-core/functional/list_spec.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/mason-core/functional/list_spec.lua b/tests/mason-core/functional/list_spec.lua index 043f058b..6b2aa2d2 100644 --- a/tests/mason-core/functional/list_spec.lua +++ b/tests/mason-core/functional/list_spec.lua @@ -279,6 +279,19 @@ describe("functional: list", function() _.split_every(0, {}) end) end) + + it("should index_by lists", function() + assert.same( + { + apple = { fruit = "apple", color = "red" }, + banana = { fruit = "banana", color = "yellow" }, + }, + _.index_by(_.prop "fruit", { + { fruit = "apple", color = "red" }, + { fruit = "banana", color = "yellow" }, + }) + ) + end) end) describe("list immutability", function() |
