summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/ChiselTestUtilitiesSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/chiselTests/ChiselTestUtilitiesSpec.scala')
-rw-r--r--src/test/scala/chiselTests/ChiselTestUtilitiesSpec.scala9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/test/scala/chiselTests/ChiselTestUtilitiesSpec.scala b/src/test/scala/chiselTests/ChiselTestUtilitiesSpec.scala
index 6d3d526c..40358d11 100644
--- a/src/test/scala/chiselTests/ChiselTestUtilitiesSpec.scala
+++ b/src/test/scala/chiselTests/ChiselTestUtilitiesSpec.scala
@@ -8,16 +8,15 @@ import org.scalatest.exceptions.TestFailedException
class ChiselTestUtilitiesSpec extends ChiselFlatSpec {
// Who tests the testers?
"assertKnownWidth" should "error when the expected width is wrong" in {
- val caught = intercept[ChiselException] {
+ intercept[TestFailedException] {
assertKnownWidth(7) {
Wire(UInt(8.W))
}
}
- assert(caught.getCause.isInstanceOf[TestFailedException])
}
it should "error when the width is unknown" in {
- a [ChiselException] shouldBe thrownBy {
+ intercept[ChiselException] {
assertKnownWidth(7) {
Wire(UInt())
}
@@ -31,12 +30,11 @@ class ChiselTestUtilitiesSpec extends ChiselFlatSpec {
}
"assertInferredWidth" should "error if the width is known" in {
- val caught = intercept[ChiselException] {
+ intercept[TestFailedException] {
assertInferredWidth(8) {
Wire(UInt(8.W))
}
}
- assert(caught.getCause.isInstanceOf[TestFailedException])
}
it should "error if the expected width is wrong" in {
@@ -57,4 +55,3 @@ class ChiselTestUtilitiesSpec extends ChiselFlatSpec {
}
}
}
-