Skip to content

Commit 1382b97

Browse files
committed
add tests
1 parent 556743e commit 1382b97

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/scala/com/github/dwickern/macros/NameOfTest.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ class NameOfTest extends AnyFunSuite with Matchers {
153153
illTyped(""" nameOf(this) """, "Unsupported expression: this")
154154
}
155155

156+
test("error: throw") {
157+
illTyped(""" nameOf(throw new Exception("test")) """,
158+
"""Unsupported expression: throw new scala\.`package`\.Exception\("test"\)""")
159+
}
160+
161+
test("error: nested") {
162+
def foo = ???
163+
illTyped(""" nameOf(nameOf(foo)) """, "Unsupported constant expression: \"foo\"")
164+
}
165+
156166
test("error: literals") {
157167
illTyped(""" nameOf("test") """, "Unsupported constant expression: \"test\"")
158168
illTyped(""" nameOf(123) """, "Unsupported constant expression: 123")

0 commit comments

Comments
 (0)