aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mason-core/result_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mason-core/result_spec.lua')
-rw-r--r--tests/mason-core/result_spec.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/mason-core/result_spec.lua b/tests/mason-core/result_spec.lua
index 1d8f36fb..d7d629f5 100644
--- a/tests/mason-core/result_spec.lua
+++ b/tests/mason-core/result_spec.lua
@@ -195,4 +195,20 @@ describe("result", function()
assert.equals("Error", failure:get_or_nil())
assert.spy(chain).was_not_called()
end)
+
+ it("should pcall", function()
+ assert.same(
+ Result.success "Great success!",
+ Result.pcall(function()
+ return "Great success!"
+ end)
+ )
+
+ assert.same(
+ Result.failure "Task failed successfully!",
+ Result.pcall(function()
+ error("Task failed successfully!", 0)
+ end)
+ )
+ end)
end)