From 3c62386a396ae0c1cd7adbaacc379eb4af072a65 Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 15 Aug 2022 21:03:06 +0200 Subject: refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296) --- tests/mason-core/functional/function_spec.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (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 8c4b41ef..4da41d40 100644 --- a/tests/mason-core/functional/function_spec.lua +++ b/tests/mason-core/functional/function_spec.lua @@ -28,7 +28,7 @@ describe("functional: function", function() end) it("coalesces first non-nil value", function() - assert.equal("Hello World!", _.coalesce(nil, nil, "Hello World!", "")) + assert.equals("Hello World!", _.coalesce(nil, nil, "Hello World!", "")) end) it("should compose functions", function() @@ -54,7 +54,7 @@ describe("functional: function", function() end) it("should not allow composing no functions", function() - local e = assert.error(function() + local e = assert.has_error(function() _.compose() end) assert.equals("compose requires at least one function", e) @@ -79,9 +79,9 @@ describe("functional: function", function() return s end) local memoized_fn = _.memoize(expensive_function) - assert.equal("key", memoized_fn "key") - assert.equal("key", memoized_fn "key") - assert.equal("new_key", memoized_fn "new_key") + assert.equals("key", memoized_fn "key") + assert.equals("key", memoized_fn "key") + assert.equals("new_key", memoized_fn "new_key") assert.spy(expensive_function).was_called(2) end) @@ -92,9 +92,9 @@ describe("functional: function", function() local memoized_fn = _.memoize(expensive_function, function(arg1, arg2) return arg1 .. arg2 end) - assert.equal("key1key2", memoized_fn("key1", "key2")) - assert.equal("key1key2", memoized_fn("key1", "key2")) - assert.equal("key1key3", memoized_fn("key1", "key3")) + assert.equals("key1key2", memoized_fn("key1", "key2")) + assert.equals("key1key2", memoized_fn("key1", "key2")) + assert.equals("key1key3", memoized_fn("key1", "key3")) assert.spy(expensive_function).was_called(2) end) @@ -120,7 +120,7 @@ describe("functional: function", function() end) local a, b = lazy_fn() assert.is_nil(a) - assert.equal(2, b) + assert.equals(2, b) end) it("should provide identity value", function() -- cgit v1.2.3-70-g09d2