diff --git a/test/Tests/src/Semantic/Error_Spec.enso b/test/Tests/src/Semantic/Error_Spec.enso index d2389362cb9b..64ccc5358c69 100644 --- a/test/Tests/src/Semantic/Error_Spec.enso +++ b/test/Tests/src/Semantic/Error_Spec.enso @@ -17,6 +17,7 @@ import Standard.Test.Extensions type My_Type Value foo + Multi_Value foo bar throw_a_bar = Error.throw "bar" throw_a_bar_panicking = Panic.throw "bar" @@ -348,17 +349,29 @@ spec = neg n:Number = -n + extract x:My_Type = x.foo + Test.specify "everything is ok" <| neg (my_func -5 -2) . should_equal 7 Test.specify "try to apply one argument" <| r = Panic.recover Type_Error <| neg (my_func -5) r . should_fail_with Type_Error - r.to_display_text.contains "Try to apply y argument" . should_be_true + r.to_display_text.should_contain "Try to apply y argument." Test.specify "try to apply two arguments" <| r = Panic.recover Type_Error <| neg my_func r . should_fail_with Type_Error - r.to_display_text.contains "Try to apply x, y arguments" . should_be_true + r.to_display_text.should_contain "Try to apply x, y arguments." + + Test.specify "report unapplied constructor nicely" <| + r = Panic.recover Type_Error <| extract My_Type.Value + r . should_fail_with Type_Error + r.to_display_text.should_contain "Try to apply foo argument." + + Test.specify "report partially applied constructor nicely" <| + r = Panic.recover Type_Error <| extract (My_Type.Multi_Value 42) + r . should_fail_with Type_Error + r.to_display_text.should_contain "Try to apply bar argument." main = Test_Suite.run_main spec