Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenComp committed Jan 14, 2024
1 parent 8418cce commit a5cff9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/Unit/Dreamberd/TestDreamberdCompilation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ testCompileNode =
, TestCase
( assertEqual
"compile Function node"
(Right [VM.DefineEnv "myFunc" VM.Define (Just (VM.Function 1 [VM.PushArg 0, VM.DefineEnv "x" VM.Override Nothing, VM.PushEnv "x", VM.Ret, VM.EraseEnv "x"]))])
(Right [VM.DefineEnv "myFunc" VM.Define (Just (VM.Function 1 [VM.PushArg 0, VM.DefineEnv "x" VM.Override Nothing, VM.PushEnv "x", VM.Ret]))])
(compileNode [] (AST.Function "myFunc" ["x"] [AST.Return (Just (AST.Identifier "x"))]))
)
, TestCase
Expand Down Expand Up @@ -239,7 +239,7 @@ testCompileFunction =
[ TestCase
( assertEqual
"compile simple function"
(Right [VM.DefineEnv "myFunc" VM.Define (Just $ VM.Function 1 [VM.PushArg 0, VM.DefineEnv "x" VM.Override Nothing, VM.PushEnv "x", VM.Ret, VM.EraseEnv "x"])])
(Right [VM.DefineEnv "myFunc" VM.Define (Just $ VM.Function 1 [VM.PushArg 0, VM.DefineEnv "x" VM.Override Nothing, VM.PushEnv "x", VM.Ret])])
(compileFunction [] "myFunc" ["x"] [AST.Return (Just (AST.Identifier "x"))])
)
, TestCase
Expand All @@ -251,7 +251,7 @@ testCompileFunction =
, TestCase
( assertEqual
"compile function with multiple parameters"
(Right [VM.DefineEnv "multiParamsFunc" VM.Define (Just $ VM.Function 3 [VM.PushArg 0, VM.DefineEnv "x" VM.Override Nothing, VM.PushArg 1, VM.DefineEnv "y" VM.Override Nothing, VM.PushArg 2, VM.DefineEnv "z" VM.Override Nothing, VM.PushEnv "x", VM.Ret, VM.EraseEnv "x", VM.EraseEnv "y", VM.EraseEnv "z"])])
(Right [VM.DefineEnv "multiParamsFunc" VM.Define (Just $ VM.Function 3 [VM.PushArg 0, VM.DefineEnv "x" VM.Override Nothing, VM.PushArg 1, VM.DefineEnv "y" VM.Override Nothing, VM.PushArg 2, VM.DefineEnv "z" VM.Override Nothing, VM.PushEnv "x", VM.Ret])])
(compileFunction [] "multiParamsFunc" ["x", "y", "z"] [AST.Return (Just (AST.Identifier "x"))])
)
]
Expand Down

0 comments on commit a5cff9f

Please sign in to comment.