summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/ScalaIntervalSimulatorTest.scala
diff options
context:
space:
mode:
authorJack Koenig2022-01-10 10:39:52 -0800
committerJack Koenig2022-01-10 15:53:55 -0800
commit3131c0daad41dea78bede4517669e376c41a325a (patch)
tree55baed78a6a01f80ff3952a08233ca553a19964f /src/test/scala/chiselTests/ScalaIntervalSimulatorTest.scala
parentdd36f97a82746cec0b25b94651581fe799e24579 (diff)
Apply scalafmt
Command: sbt scalafmtAll
Diffstat (limited to 'src/test/scala/chiselTests/ScalaIntervalSimulatorTest.scala')
-rw-r--r--src/test/scala/chiselTests/ScalaIntervalSimulatorTest.scala116
1 files changed, 58 insertions, 58 deletions
diff --git a/src/test/scala/chiselTests/ScalaIntervalSimulatorTest.scala b/src/test/scala/chiselTests/ScalaIntervalSimulatorTest.scala
index 540cc456..94f5ccc7 100644
--- a/src/test/scala/chiselTests/ScalaIntervalSimulatorTest.scala
+++ b/src/test/scala/chiselTests/ScalaIntervalSimulatorTest.scala
@@ -11,87 +11,87 @@ class ScalaIntervalSimulatorSpec extends AnyFreeSpec with Matchers {
"clip tests" - {
"Should work for closed ranges" in {
val sim = ScalaIntervalSimulator(range"[2,4]")
- sim.clip(BigDecimal(1.0)) should be (2.0)
- sim.clip(BigDecimal(2.0)) should be (2.0)
- sim.clip(BigDecimal(3.0)) should be (3.0)
- sim.clip(BigDecimal(4.0)) should be (4.0)
- sim.clip(BigDecimal(5.0)) should be (4.0)
+ sim.clip(BigDecimal(1.0)) should be(2.0)
+ sim.clip(BigDecimal(2.0)) should be(2.0)
+ sim.clip(BigDecimal(3.0)) should be(3.0)
+ sim.clip(BigDecimal(4.0)) should be(4.0)
+ sim.clip(BigDecimal(5.0)) should be(4.0)
}
"Should work for closed ranges with binary point" in {
val sim = ScalaIntervalSimulator(range"[2,6].2")
- sim.clip(BigDecimal(1.75)) should be (2.0)
- sim.clip(BigDecimal(2.0)) should be (2.0)
- sim.clip(BigDecimal(2.25)) should be (2.25)
- sim.clip(BigDecimal(2.5)) should be (2.5)
- sim.clip(BigDecimal(5.75)) should be (5.75)
- sim.clip(BigDecimal(6.0)) should be (6.0)
- sim.clip(BigDecimal(6.25)) should be (6.0)
- sim.clip(BigDecimal(6.5)) should be (6.0)
- sim.clip(BigDecimal(8.5)) should be (6.0)
+ sim.clip(BigDecimal(1.75)) should be(2.0)
+ sim.clip(BigDecimal(2.0)) should be(2.0)
+ sim.clip(BigDecimal(2.25)) should be(2.25)
+ sim.clip(BigDecimal(2.5)) should be(2.5)
+ sim.clip(BigDecimal(5.75)) should be(5.75)
+ sim.clip(BigDecimal(6.0)) should be(6.0)
+ sim.clip(BigDecimal(6.25)) should be(6.0)
+ sim.clip(BigDecimal(6.5)) should be(6.0)
+ sim.clip(BigDecimal(8.5)) should be(6.0)
}
"Should work for open ranges" in {
val sim = ScalaIntervalSimulator(range"(2,4)")
- sim.clip(BigDecimal(1.0)) should be (3.0)
- sim.clip(BigDecimal(2.0)) should be (3.0)
- sim.clip(BigDecimal(3.0)) should be (3.0)
- sim.clip(BigDecimal(4.0)) should be (3.0)
- sim.clip(BigDecimal(5.0)) should be (3.0)
+ sim.clip(BigDecimal(1.0)) should be(3.0)
+ sim.clip(BigDecimal(2.0)) should be(3.0)
+ sim.clip(BigDecimal(3.0)) should be(3.0)
+ sim.clip(BigDecimal(4.0)) should be(3.0)
+ sim.clip(BigDecimal(5.0)) should be(3.0)
}
"Should work for open ranges with binary point" in {
val sim = ScalaIntervalSimulator(range"(2,6).2")
- sim.clip(BigDecimal(1.75)) should be (2.25)
- sim.clip(BigDecimal(2.0)) should be (2.25)
- sim.clip(BigDecimal(2.25)) should be (2.25)
- sim.clip(BigDecimal(2.5)) should be (2.5)
- sim.clip(BigDecimal(5.75)) should be (5.75)
- sim.clip(BigDecimal(6.0)) should be (5.75)
- sim.clip(BigDecimal(6.25)) should be (5.75)
- sim.clip(BigDecimal(6.5)) should be (5.75)
- sim.clip(BigDecimal(8.5)) should be (5.75)
+ sim.clip(BigDecimal(1.75)) should be(2.25)
+ sim.clip(BigDecimal(2.0)) should be(2.25)
+ sim.clip(BigDecimal(2.25)) should be(2.25)
+ sim.clip(BigDecimal(2.5)) should be(2.5)
+ sim.clip(BigDecimal(5.75)) should be(5.75)
+ sim.clip(BigDecimal(6.0)) should be(5.75)
+ sim.clip(BigDecimal(6.25)) should be(5.75)
+ sim.clip(BigDecimal(6.5)) should be(5.75)
+ sim.clip(BigDecimal(8.5)) should be(5.75)
}
}
"wrap tests" - {
"Should work for closed ranges" in {
val sim = ScalaIntervalSimulator(range"[2,6]")
- sim.wrap(BigDecimal(1.0)) should be (6.0)
- sim.wrap(BigDecimal(2.0)) should be (2.0)
- sim.wrap(BigDecimal(3.0)) should be (3.0)
- sim.wrap(BigDecimal(4.0)) should be (4.0)
- sim.wrap(BigDecimal(5.0)) should be (5.0)
- sim.wrap(BigDecimal(6.0)) should be (6.0)
- sim.wrap(BigDecimal(7.0)) should be (2.0)
+ sim.wrap(BigDecimal(1.0)) should be(6.0)
+ sim.wrap(BigDecimal(2.0)) should be(2.0)
+ sim.wrap(BigDecimal(3.0)) should be(3.0)
+ sim.wrap(BigDecimal(4.0)) should be(4.0)
+ sim.wrap(BigDecimal(5.0)) should be(5.0)
+ sim.wrap(BigDecimal(6.0)) should be(6.0)
+ sim.wrap(BigDecimal(7.0)) should be(2.0)
}
"Should work for closed ranges with binary point" in {
val sim = ScalaIntervalSimulator(range"[2,6].2")
- sim.wrap(BigDecimal(1.75)) should be (6.0)
- sim.wrap(BigDecimal(2.0)) should be (2.0)
- sim.wrap(BigDecimal(2.25)) should be (2.25)
- sim.wrap(BigDecimal(2.5)) should be (2.5)
- sim.wrap(BigDecimal(5.75)) should be (5.75)
- sim.wrap(BigDecimal(6.0)) should be (6.0)
- sim.wrap(BigDecimal(6.25)) should be (2.0)
- sim.wrap(BigDecimal(6.5)) should be (2.25)
+ sim.wrap(BigDecimal(1.75)) should be(6.0)
+ sim.wrap(BigDecimal(2.0)) should be(2.0)
+ sim.wrap(BigDecimal(2.25)) should be(2.25)
+ sim.wrap(BigDecimal(2.5)) should be(2.5)
+ sim.wrap(BigDecimal(5.75)) should be(5.75)
+ sim.wrap(BigDecimal(6.0)) should be(6.0)
+ sim.wrap(BigDecimal(6.25)) should be(2.0)
+ sim.wrap(BigDecimal(6.5)) should be(2.25)
}
"Should work for open ranges" in {
val sim = ScalaIntervalSimulator(range"(2,6)")
- sim.wrap(BigDecimal(1.0)) should be (4.0)
- sim.wrap(BigDecimal(2.0)) should be (5.0)
- sim.wrap(BigDecimal(3.0)) should be (3.0)
- sim.wrap(BigDecimal(4.0)) should be (4.0)
- sim.wrap(BigDecimal(5.0)) should be (5.0)
- sim.wrap(BigDecimal(6.0)) should be (3.0)
- sim.wrap(BigDecimal(7.0)) should be (4.0)
+ sim.wrap(BigDecimal(1.0)) should be(4.0)
+ sim.wrap(BigDecimal(2.0)) should be(5.0)
+ sim.wrap(BigDecimal(3.0)) should be(3.0)
+ sim.wrap(BigDecimal(4.0)) should be(4.0)
+ sim.wrap(BigDecimal(5.0)) should be(5.0)
+ sim.wrap(BigDecimal(6.0)) should be(3.0)
+ sim.wrap(BigDecimal(7.0)) should be(4.0)
}
"Should work for open ranges with binary point" in {
val sim = ScalaIntervalSimulator(range"(2,6).2")
- sim.wrap(BigDecimal(1.75)) should be (5.5)
- sim.wrap(BigDecimal(2.0)) should be (5.75)
- sim.wrap(BigDecimal(2.25)) should be (2.25)
- sim.wrap(BigDecimal(2.5)) should be (2.5)
- sim.wrap(BigDecimal(5.75)) should be (5.75)
- sim.wrap(BigDecimal(6.0)) should be (2.25)
- sim.wrap(BigDecimal(6.25)) should be (2.5)
- sim.wrap(BigDecimal(7.0)) should be (3.25)
+ sim.wrap(BigDecimal(1.75)) should be(5.5)
+ sim.wrap(BigDecimal(2.0)) should be(5.75)
+ sim.wrap(BigDecimal(2.25)) should be(2.25)
+ sim.wrap(BigDecimal(2.5)) should be(2.5)
+ sim.wrap(BigDecimal(5.75)) should be(5.75)
+ sim.wrap(BigDecimal(6.0)) should be(2.25)
+ sim.wrap(BigDecimal(6.25)) should be(2.5)
+ sim.wrap(BigDecimal(7.0)) should be(3.25)
}
}
}