From c7917c88f8e8aaa93255a731c75f3e0e6901e2fb Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Fri, 10 Sep 2021 11:04:43 -0700 Subject: MemConf: Do not add another new line when serializing (#2354) --- src/test/scala/firrtlTests/ReplSeqMemTests.scala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/ReplSeqMemTests.scala b/src/test/scala/firrtlTests/ReplSeqMemTests.scala index 414fc6af..9f83bec2 100644 --- a/src/test/scala/firrtlTests/ReplSeqMemTests.scala +++ b/src/test/scala/firrtlTests/ReplSeqMemTests.scala @@ -49,6 +49,12 @@ class ReplSeqMemSpec extends SimpleTransformSpec { }.get // Verify that this does not throw an exception val fromConf = MemConf.fromString(text) + // Verify that the number of lines in the Conf file is equivalent to the number + // of entries (no missing or extra newlines) + require( + fromConf.size == text.count(_ == '\n'), + s"Unexpected newlines in mem.conf file containing ${fromConf.size} confs:\n${text}" + ) // Verify the mems in the conf are the same as the expected ones require( Set(fromConf: _*) == mems, -- cgit v1.2.3