From 79c17c8448c8c15a245c3435d9c97c128738121e Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 22 Sep 2022 16:00:35 -0700 Subject: Fix serialization of whens with empty blocks (#2560) Also get rid of whitespace-only lines that were emitted after every when block.--- src/test/scala/firrtlTests/SerializerSpec.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/SerializerSpec.scala b/src/test/scala/firrtlTests/SerializerSpec.scala index 797a6045..9a984d60 100644 --- a/src/test/scala/firrtlTests/SerializerSpec.scala +++ b/src/test/scala/firrtlTests/SerializerSpec.scala @@ -116,4 +116,9 @@ class SerializerSpec extends AnyFlatSpec with Matchers { serialized should be(childModuleTabbed) } + it should "emit whens with empty Blocks correctly" in { + val when = Conditionally(NoInfo, Reference("cond"), Block(Seq()), EmptyStmt) + val serialized = Serializer.serialize(when, 1) + serialized should be(" when cond :\n skip\n") + } } -- cgit v1.2.3