summaryrefslogtreecommitdiff
path: root/src/test/scala
diff options
context:
space:
mode:
authorJack Koenig2017-02-09 00:33:17 -0800
committerAndrew Waterman2017-02-24 04:50:55 -0800
commit55c2bd293473d92f8df1ef83bb627992b173ce8e (patch)
treea2f4d12e6f446c3b791c8b9ccd1ce80f855b9956 /src/test/scala
parenta7aafe90c87e0d7931fa15c6214a97f4496a08cb (diff)
Escape % in assertion messages
Diffstat (limited to 'src/test/scala')
-rw-r--r--src/test/scala/chiselTests/Assert.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/Assert.scala b/src/test/scala/chiselTests/Assert.scala
index 475e18f7..076786cd 100644
--- a/src/test/scala/chiselTests/Assert.scala
+++ b/src/test/scala/chiselTests/Assert.scala
@@ -44,6 +44,12 @@ class PipelinedResetTester extends BasicTester {
}
}
+class ModuloAssertTester extends BasicTester {
+ assert((4.U % 2.U) === 0.U)
+ assert(1.U === 1.U, "I'm 110% sure this will succeed")
+ stop()
+}
+
class AssertSpec extends ChiselFlatSpec {
"A failing assertion" should "fail the testbench" in {
assert(!runTester{ new FailingAssertTester })
@@ -54,4 +60,7 @@ class AssertSpec extends ChiselFlatSpec {
"An assertion" should "not assert until we come out of reset" in {
assertTesterPasses{ new PipelinedResetTester }
}
+ "Assertions" should "allow the modulo operator % in the message" in {
+ assertTesterPasses{ new ModuloAssertTester }
+ }
}