Skip to content

Commit

Permalink
Add bad8 to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Nov 15, 2014
1 parent 77cefbd commit bbcc629
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/scala/SemanticSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,13 @@ class SemanticFinalSpec extends FlatSpec with Matchers {
errs(1).getMessage should include ("Function 'Binky' expects 3 arguments but 1 given")
errs(2).getMessage should include ("Incompatible operands: double = int")
}
it should "detect the errors in bad8.decaf" in {
val (scopes, errs) = analyze("bad8.decaf")
errs should have length 4 // we are skipping the first error due to encapsulation
errs(0).getMessage should include ("Honda has no such field 'horn'")
errs(1).getMessage should include ("Honda has no such field 'Honk'")
errs(2).getMessage should include ("Incompatible operands: Boat < Honda")
errs(2).getMessage should include ("Incompatible operands: Honda = bool")
}

}

0 comments on commit bbcc629

Please sign in to comment.