aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorJack Koenig2018-03-21 10:53:42 -0700
committerAdam Izraelevitz2018-03-21 10:53:42 -0700
commit6b195e4a5348eed2e714e1183024588c5f91a283 (patch)
tree15f5db0f35e4d613e10ab71a224f656d8a8ff647 /src/test
parentf55553b1df0ab083f4f53862e6cf200bd9ceab3e (diff)
Add SyntaxErrorsException as a type of ParserException (#770)
Also make ParserException extend FIRRTLException to better report parsing errors to the user
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/ParserSpec.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ParserSpec.scala b/src/test/scala/firrtlTests/ParserSpec.scala
index 4ed16afe..384b75d2 100644
--- a/src/test/scala/firrtlTests/ParserSpec.scala
+++ b/src/test/scala/firrtlTests/ParserSpec.scala
@@ -157,6 +157,20 @@ class ParserSpec extends FirrtlFlatSpec {
val c = firrtl.Parser.parse(input)
firrtl.Parser.parse(c.serialize)
}
+
+ "Parsing errors" should "be reported as normal exceptions" in {
+ val input = s"""
+ |circuit Test
+ | module Test :
+
+ |""".stripMargin
+ val manager = new ExecutionOptionsManager("test") with HasFirrtlOptions {
+ firrtlOptions = FirrtlExecutionOptions(firrtlSource = Some(input))
+ }
+ a [SyntaxErrorsException] shouldBe thrownBy {
+ Driver.execute(manager)
+ }
+ }
}
class ParserPropSpec extends FirrtlPropSpec {