aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAlbert Chen2020-04-10 12:20:32 -0700
committerGitHub2020-04-10 19:20:32 +0000
commit632930723adc2f78d4d6445acf5f8bcc250a6c0c (patch)
treee2f331cf6e9685e3447135f790764ffddc59cbe5 /src/test
parent18d5154c83f9af99ff0c90d6b2c1329af4f1a949 (diff)
Add ground type serializer (#1502)
* update JsonProtocolSpec to test GroundType * add custom serializer for GroundType * get rid of trailing comma Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/annotationTests/JsonProtocolSpec.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/scala/firrtlTests/annotationTests/JsonProtocolSpec.scala b/src/test/scala/firrtlTests/annotationTests/JsonProtocolSpec.scala
index 2dce89db..507c5291 100644
--- a/src/test/scala/firrtlTests/annotationTests/JsonProtocolSpec.scala
+++ b/src/test/scala/firrtlTests/annotationTests/JsonProtocolSpec.scala
@@ -14,7 +14,8 @@ case class AnAnnotation(
port: Port,
statement: Statement,
expr: Expression,
- tpe: Type
+ tpe: Type,
+ groundType: GroundType
) extends NoTargetAnnotation
class JsonProtocolSpec extends FlatSpec with Matchers {
@@ -33,10 +34,10 @@ class JsonProtocolSpec extends FlatSpec with Matchers {
val stmt = mod.asInstanceOf[Module].body
val expr = stmt.asInstanceOf[Block].stmts.head.asInstanceOf[Connect].expr
val tpe = port.tpe
- val inputAnnos = Seq(AnAnnotation(cir.info, cir, mod, port, stmt, expr, tpe))
+ val groundType = port.tpe.asInstanceOf[GroundType]
+ val inputAnnos = Seq(AnAnnotation(cir.info, cir, mod, port, stmt, expr, tpe, groundType))
val annosString = JsonProtocol.serialize(inputAnnos)
val outputAnnos = JsonProtocol.deserialize(annosString)
inputAnnos should be (outputAnnos)
}
-
}