From 04d0bed56c884e85d900553315e853627550f596 Mon Sep 17 00:00:00 2001 From: Dan Doel Date: Tue, 22 Sep 2020 17:43:44 -0400 Subject: [PATCH] Add test case for bad variable indexing behavior --- parser-typechecker/tests/Unison/Test/MCode.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/parser-typechecker/tests/Unison/Test/MCode.hs b/parser-typechecker/tests/Unison/Test/MCode.hs index fc29af1f2..a2df150e0 100644 --- a/parser-typechecker/tests/Unison/Test/MCode.hs +++ b/parser-typechecker/tests/Unison/Test/MCode.hs @@ -90,6 +90,20 @@ nested \ m@n -> n\n\ \ ##todo (##Nat.== x 2)" +matching'arguments :: String +matching'arguments + = "let\n\ + \ f x y z = y\n\ + \ g x = f x\n\ + \ blorf = let\n\ + \ a = 0\n\ + \ b = 1\n\ + \ d = 2\n\ + \ h = g a b\n\ + \ c = 2\n\ + \ h c\n\ + \ ##todo (##Nat.== blorf 1)" + test :: Test () test = scope "mcode" . tests $ [ scope "2=2" $ testEval "##todo (##Nat.== 2 2)" @@ -102,4 +116,6 @@ test = scope "mcode" . tests $ , scope "5*1000=5000 rec" $ testEval multRec , scope "nested" $ testEval nested + , scope "matching arguments" + $ testEval matching'arguments ]