aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/transforms/CombineCatsSpec.scala
diff options
context:
space:
mode:
authorchick2020-08-14 19:47:53 -0700
committerJack Koenig2020-08-14 19:47:53 -0700
commit6fc742bfaf5ee508a34189400a1a7dbffe3f1cac (patch)
tree2ed103ee80b0fba613c88a66af854ae9952610ce /src/test/scala/firrtlTests/transforms/CombineCatsSpec.scala
parentb516293f703c4de86397862fee1897aded2ae140 (diff)
All of src/ formatted with scalafmt
Diffstat (limited to 'src/test/scala/firrtlTests/transforms/CombineCatsSpec.scala')
-rw-r--r--src/test/scala/firrtlTests/transforms/CombineCatsSpec.scala49
1 files changed, 33 insertions, 16 deletions
diff --git a/src/test/scala/firrtlTests/transforms/CombineCatsSpec.scala b/src/test/scala/firrtlTests/transforms/CombineCatsSpec.scala
index f2672bce..a916eac5 100644
--- a/src/test/scala/firrtlTests/transforms/CombineCatsSpec.scala
+++ b/src/test/scala/firrtlTests/transforms/CombineCatsSpec.scala
@@ -14,9 +14,11 @@ class CombineCatsSpec extends FirrtlFlatSpec {
private val annotations = Seq(new MaxCatLenAnnotation(12))
private def execute(input: String, transforms: Seq[Transform], annotations: AnnotationSeq): CircuitState = {
- val c = transforms.foldLeft(CircuitState(parse(input), UnknownForm, annotations)) {
- (c: CircuitState, t: Transform) => t.runTransform(c)
- }.circuit
+ val c = transforms
+ .foldLeft(CircuitState(parse(input), UnknownForm, annotations)) { (c: CircuitState, t: Transform) =>
+ t.runTransform(c)
+ }
+ .circuit
CircuitState(c, UnknownForm, Seq(), None)
}
@@ -86,11 +88,24 @@ class CombineCatsSpec extends FirrtlFlatSpec {
// temp5 should get cat(cat(cat(in3, in2), cat(in4, in3)), cat(cat(in3, in2), cat(in4, in3)))
result should containTree {
- case DoPrim(Cat, Seq(
- DoPrim(Cat, Seq(
- DoPrim(Cat, Seq(WRef("in2", _, _, _), WRef("in1", _, _, _)), _, _),
- DoPrim(Cat, Seq(WRef("in3", _, _, _), WRef("in2", _, _, _)), _, _)), _, _),
- DoPrim(Cat, Seq(WRef("in4", _, _, _), WRef("in3", _, _, _)), _, _)), _, _) => true
+ case DoPrim(
+ Cat,
+ Seq(
+ DoPrim(
+ Cat,
+ Seq(
+ DoPrim(Cat, Seq(WRef("in2", _, _, _), WRef("in1", _, _, _)), _, _),
+ DoPrim(Cat, Seq(WRef("in3", _, _, _), WRef("in2", _, _, _)), _, _)
+ ),
+ _,
+ _
+ ),
+ DoPrim(Cat, Seq(WRef("in4", _, _, _), WRef("in3", _, _, _)), _, _)
+ ),
+ _,
+ _
+ ) =>
+ true
}
}
@@ -117,17 +132,19 @@ class CombineCatsSpec extends FirrtlFlatSpec {
// should not contain any cat chains greater than 3
result shouldNot containTree {
- case DoPrim(Cat, Seq(_, DoPrim(Cat, Seq(_, DoPrim(Cat, _, _, _)), _, _)), _, _) => true
+ case DoPrim(Cat, Seq(_, DoPrim(Cat, Seq(_, DoPrim(Cat, _, _, _)), _, _)), _, _) => true
case DoPrim(Cat, Seq(_, DoPrim(Cat, Seq(_, DoPrim(Cat, Seq(_, DoPrim(Cat, _, _, _)), _, _)), _, _)), _, _) => true
}
// temp2 should get cat(in3, cat(in2, in1))
result should containTree {
- case DoPrim(Cat, Seq(
- WRef("in3", _, _, _),
- DoPrim(Cat, Seq(
- WRef("in2", _, _, _),
- WRef("in1", _, _, _)), _, _)), _, _) => true
+ case DoPrim(
+ Cat,
+ Seq(WRef("in3", _, _, _), DoPrim(Cat, Seq(WRef("in2", _, _, _), WRef("in1", _, _, _)), _, _)),
+ _,
+ _
+ ) =>
+ true
}
}
@@ -152,8 +169,8 @@ class CombineCatsSpec extends FirrtlFlatSpec {
val result = execute(input, transforms, Seq.empty)
result shouldNot containTree {
- case DoPrim(Cat, Seq(_, DoPrim(Add, _, _, _)), _, _) => true
- case DoPrim(Cat, Seq(_, DoPrim(Sub, _, _, _)), _, _) => true
+ case DoPrim(Cat, Seq(_, DoPrim(Add, _, _, _)), _, _) => true
+ case DoPrim(Cat, Seq(_, DoPrim(Sub, _, _, _)), _, _) => true
case DoPrim(Cat, Seq(_, DoPrim(Cat, Seq(_, DoPrim(Cat, _, _, _)), _, _)), _, _) => true
}
}