From 922d43c085585b9eb0276ff2e8e680ca93ec1c2e Mon Sep 17 00:00:00 2001 From: Jim Lawson Date: Mon, 25 Jul 2016 08:48:41 -0700 Subject: catch Bad connection exception --- src/test/scala/chiselTests/Direction.scala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/test/scala') diff --git a/src/test/scala/chiselTests/Direction.scala b/src/test/scala/chiselTests/Direction.scala index e22e120b..bb01f0eb 100644 --- a/src/test/scala/chiselTests/Direction.scala +++ b/src/test/scala/chiselTests/Direction.scala @@ -31,7 +31,15 @@ class DirectionSpec extends ChiselPropSpec { } property("Inputs should not be assignable") { - elaborate(new BadDirection) + var excepts: Boolean = false + try elaborate(new BadDirection) + catch { + case e: Exception => { + excepts = true + } + // Should except so this is okay + // Ideally, would throw and catch more precise exception + } + assert(excepts, "Bad connection should have thrown exception!") } - } -- cgit v1.2.3