diff options
Diffstat (limited to 'src/test/scala/chiselTests/Assert.scala')
| -rw-r--r-- | src/test/scala/chiselTests/Assert.scala | 9 |
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 } + } } |
