aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMegan Wachs2021-09-10 11:04:43 -0700
committerGitHub2021-09-10 11:04:43 -0700
commitc7917c88f8e8aaa93255a731c75f3e0e6901e2fb (patch)
tree198964b9ed7662393975f9d0c6e0721060df4411 /src/test
parent441930e2ad03f48adc052cd1d00af3d10d786dca (diff)
MemConf: Do not add another new line when serializing (#2354)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/ReplSeqMemTests.scala6
1 files changed, 6 insertions, 0 deletions
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,