From 243ff24f8eb9aae18bb0c7afe4f4c1e6cd66c084 Mon Sep 17 00:00:00 2001 From: Colin Schmidt Date: Tue, 19 Apr 2016 09:51:24 -0700 Subject: add better type mismatch error message also check for it int unittest --- src/test/scala/firrtlTests/UnitTests.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/UnitTests.scala b/src/test/scala/firrtlTests/UnitTests.scala index cee2c15d..dac8a40f 100644 --- a/src/test/scala/firrtlTests/UnitTests.scala +++ b/src/test/scala/firrtlTests/UnitTests.scala @@ -60,11 +60,12 @@ class UnitTests extends FirrtlFlatSpec { | input y: {a : UInt<1>} | output x: {a : UInt<1>, b : UInt<1>} | x <= y""".stripMargin - intercept[PassExceptions] { + val thrown = intercept[PassExceptions] { passes.foldLeft(parse(input)) { (c: Circuit, p: Pass) => p.run(c) } } + assert(thrown.getMessage contains "Type mismatch. Cannot connect") } "Initializing a register with a different type" should "throw an exception" in { -- cgit v1.2.3