Compare commits

...

2 Commits

Author SHA1 Message Date
billsun b9baeda56f a
8 months ago
billsun e0bdf2e33d a
8 months ago

@ -14,6 +14,7 @@ class ParserTest extends TimedSuite {
assert(ast == LetRec(Nil, res), "Invalid result")
}
//see examples/hello.scala and pow.scala for more comprehensive tests
test("SingleDigit") {
testBaseParser("1", Lit(1))

@ -42,10 +42,12 @@ class SemanticAnalyzerTest extends TimedSuite {
assert(e == nError, "Incorrect number of Errors")
assert(astTypeEquals(tast, tsa), "AST does not have correct type")
}
//see examples/hello.scala and pow.scala for more comprehensive tests
test("NoErrorNoWarning") {
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)
}
//see examples/hello.scala and pow.scala for more comprehensive tests
}

Loading…
Cancel
Save