summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/Module.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/Module.scala b/src/test/scala/chiselTests/Module.scala
index f730d08b..d8cae510 100644
--- a/src/test/scala/chiselTests/Module.scala
+++ b/src/test/scala/chiselTests/Module.scala
@@ -158,4 +158,19 @@ class ModuleSpec extends ChiselPropSpec {
(the [Exception] thrownBy (Driver.elaborate(() => new NullModuleWrapper)))
.getMessage should include ("desiredName of chiselTests.NullModuleWrapper is null")
}
+ property("The name of a module in a function should be sane") {
+ def foo = {
+ class Foo1 extends RawModule {
+ assert(name == "Foo1")
+ }
+ new Foo1
+ }
+ Driver.elaborate(() => foo)
+ }
+ property("The name of an anonymous module should include '_Anon'") {
+ trait Foo { this: RawModule =>
+ assert(name.contains("_Anon"))
+ }
+ Driver.elaborate(() => new RawModule with Foo)
+ }
}