Skip to content

Commit 13558f1

Browse files
committed
test(compiler): add ocr print-string test
1 parent e78f001 commit 13558f1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package ptp_compiler
2+
3+
import org.scalatest.flatspec.AnyFlatSpec
4+
import scala.io.Source
5+
import tools.compiler.Compiler
6+
import testingtools.FileHandler.compareFile
7+
import org.scalatest.matchers.should._
8+
9+
class OCRCompilerIntegrationSpec extends AnyFlatSpec with Matchers {
10+
11+
"print-string.ocr" should "compile to print-string.ptb" in {
12+
val sourceFilename = "examples/ocr/pseudocode/print-string.ocr"
13+
val compiler = new Compiler(Source.fromFile(sourceFilename).getLines().mkString)
14+
assert(compareFile(compiler.compile, "examples/ocr/bytecode/print-string.ptb"))
15+
}
16+
}

0 commit comments

Comments
 (0)