aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/firrtlTests/FirrtlSpec.scala15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/test/scala/firrtlTests/FirrtlSpec.scala b/src/test/scala/firrtlTests/FirrtlSpec.scala
index 930100b3..8e1dd8cb 100644
--- a/src/test/scala/firrtlTests/FirrtlSpec.scala
+++ b/src/test/scala/firrtlTests/FirrtlSpec.scala
@@ -29,6 +29,7 @@ package firrtlTests
import java.io._
+import com.typesafe.scalalogging.LazyLogging
import scala.sys.process._
import org.scalatest._
import org.scalatest.prop._
@@ -146,7 +147,17 @@ trait FirrtlRunners extends BackendCompilationUtilities {
}
}
-class FirrtlPropSpec extends PropSpec with PropertyChecks with FirrtlRunners
+trait FirrtlMatchers {
+ // Replace all whitespace with a single space and remove leading and
+ // trailing whitespace
+ // Note this is intended for single-line strings, no newlines
+ def normalized(s: String): String = {
+ require(!s.contains("\n"))
+ s.replaceAll("\\s+", " ").trim
+ }
+}
+
+class FirrtlPropSpec extends PropSpec with PropertyChecks with FirrtlRunners with LazyLogging
-class FirrtlFlatSpec extends FlatSpec with Matchers with FirrtlRunners
+class FirrtlFlatSpec extends FlatSpec with Matchers with FirrtlRunners with FirrtlMatchers with LazyLogging