From fbc72a0c2fe16a93b18ce8facdc9b66e7183f75d Mon Sep 17 00:00:00 2001 From: William Boman Date: Sat, 10 Dec 2022 19:55:41 +0100 Subject: feat(functional): add some more functions (#755) --- tests/mason-core/functional/function_spec.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/mason-core/functional/function_spec.lua') diff --git a/tests/mason-core/functional/function_spec.lua b/tests/mason-core/functional/function_spec.lua index 23af1933..6b36b53b 100644 --- a/tests/mason-core/functional/function_spec.lua +++ b/tests/mason-core/functional/function_spec.lua @@ -160,4 +160,21 @@ describe("functional: function", function() assert.spy(target).was_called(1) assert.spy(target).was_called_with("These", "Nuts") end) + + it("should apply spec", function() + local apply = _.apply_spec { + sum = _.add(2), + list = { _.add(2), _.add(6) }, + nested = { + sum = _.min(2), + }, + } + assert.same({ + sum = 4, + list = { 4, 8 }, + nested = { + sum = 0, + }, + }, apply(2)) + end) end) -- cgit v1.2.3-70-g09d2