Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Fix compil of test
Browse files Browse the repository at this point in the history
  • Loading branch information
Saverio976 committed Dec 18, 2023
1 parent a6a0fcc commit 8ff83b3
Showing 1 changed file with 39 additions and 28 deletions.
67 changes: 39 additions & 28 deletions test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -267,43 +267,54 @@ unitTestsComputeFunctions = testGroup "Tests compute functions"
, testCase "(define (fact n) (if (< n 2) 1 (* n (fact (- n 1))))); (fact 5)" $
assertEqual "(define (fact n) (if (< n 2) 1 (* n (fact (- n 1))))); (fact 5)"
(Env {
defines = [], errors = [], functions = [
defines = [],
errors = [],
functions = [
Function {
name = "fact", params = ["n"], bodies = [
(List [
name = "fact",
params = ["n"],
bodies = [
List [
Symbol "if",
List [
Symbol "<", Symbol "n", Number 2],
List [Symbol "<", Symbol "n", Number 2],
Number 1,
List [
Symbol "*", Symbol "n",
List [
Symbol "fact", List [
Symbol "-", Symbol "n", Number 1]
]
Symbol "*",
Symbol "n",
List [
Symbol "fact",
List [Symbol "-", Symbol "n", Number 1]
]
]
]),
[
Left (Just (Number 120))
]
]
}
]
})
(computeAllAST (defaultEnv) [(List [
Symbol "if",
List [
Symbol "<", Symbol "n", Number 2],
Number 1,
List [
Symbol "*", Symbol "n",
List [
Symbol "fact", List [
Symbol "-", Symbol "n", Number 1]
]
]
]),
(List [Symbol "func", Number 5])])
}, [Left (Just (Number 120))])
(computeAllAST (defaultEnv) [
List [
Symbol "define",
List [Symbol "fact", Symbol "n"],
List [
Symbol "if",
List [Symbol "<", Symbol "n", Number 2],
Number 1,
List [
Symbol "*",
Symbol "n",
List [
Symbol "fact",
List [Symbol "-", Symbol "n", Number 1]
]
]
]
],
List [
Symbol "fact",
Number 5
]
]
)
]

unitTestsComputeConditions :: TestTree
Expand Down

0 comments on commit 8ff83b3

Please sign in to comment.