Compare commits
2
Commits
1c282af443
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9baeda56f | ||
|
|
e0bdf2e33d |
@@ -14,6 +14,7 @@ class ParserTest extends TimedSuite {
|
|||||||
|
|
||||||
assert(ast == LetRec(Nil, res), "Invalid result")
|
assert(ast == LetRec(Nil, res), "Invalid result")
|
||||||
}
|
}
|
||||||
|
//see examples/hello.scala and pow.scala for more comprehensive tests
|
||||||
|
|
||||||
test("SingleDigit") {
|
test("SingleDigit") {
|
||||||
testBaseParser("1", Lit(1))
|
testBaseParser("1", Lit(1))
|
||||||
|
|||||||
@@ -42,10 +42,12 @@ class SemanticAnalyzerTest extends TimedSuite {
|
|||||||
assert(e == nError, "Incorrect number of Errors")
|
assert(e == nError, "Incorrect number of Errors")
|
||||||
assert(astTypeEquals(tast, tsa), "AST does not have correct type")
|
assert(astTypeEquals(tast, tsa), "AST does not have correct type")
|
||||||
}
|
}
|
||||||
|
//see examples/hello.scala and pow.scala for more comprehensive tests
|
||||||
|
|
||||||
test("NoErrorNoWarning") {
|
test("NoErrorNoWarning") {
|
||||||
testSemanticAnalyzer(Lit(1), Lit(1).withType(IntType), 0, 0)
|
testSemanticAnalyzer(Lit(1), Lit(1).withType(IntType), 0, 0)
|
||||||
testSemanticAnalyzer(Prim("+", List(Lit(1), Lit(2))), Prim("+", List(Lit(1).withType(IntType), Lit(2).withType(IntType))).withType(IntType), 0, 0)
|
testSemanticAnalyzer(Prim("+", List(Lit(1), Lit(2))), Prim("+", List(Lit(1).withType(IntType), Lit(2).withType(IntType))).withType(IntType), 0, 0)
|
||||||
}
|
}
|
||||||
|
//see examples/hello.scala and pow.scala for more comprehensive tests
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user