summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests
diff options
context:
space:
mode:
authorducky2016-11-16 14:15:37 -0800
committerducky2016-11-21 12:48:10 -0800
commit2db9bc81015000b5ee4581dc57c0f339ae9f9329 (patch)
tree85c2dffdc910080dc49f4951b0a91cd0b1714697 /src/test/scala/chiselTests
parentc9849a59d5ea0315096ff5f90db22ce39c7f4cc5 (diff)
Add invalid range specifier test
Diffstat (limited to 'src/test/scala/chiselTests')
-rw-r--r--src/test/scala/chiselTests/RangeSpec.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/RangeSpec.scala b/src/test/scala/chiselTests/RangeSpec.scala
index 509ed82e..cbac4d4c 100644
--- a/src/test/scala/chiselTests/RangeSpec.scala
+++ b/src/test/scala/chiselTests/RangeSpec.scala
@@ -84,5 +84,18 @@ class RangeSpec extends FreeSpec with Matchers {
SInt(range"(0,0)")
}
}
+
+ "Invalid range specifiers should fail at compile time" in {
+ assertDoesNotCompile(""" range"" """)
+ assertDoesNotCompile(""" range"[]" """)
+ assertDoesNotCompile(""" range"0" """)
+ assertDoesNotCompile(""" range"[0]" """)
+ assertDoesNotCompile(""" range"[0, 1" """)
+ assertDoesNotCompile(""" range"0, 1]" """)
+ assertDoesNotCompile(""" range"[0, 1, 2]" """)
+ assertDoesNotCompile(""" range"[a]" """)
+ assertDoesNotCompile(""" range"[a, b]" """)
+ assertCompiles(""" range"[0, 1]" """) // syntax sanity check
+ }
}
}