diff options
author | VladimirNik <vladimir.nikolaev9@gmail.com> | 2014-01-07 03:48:43 +0400 |
---|---|---|
committer | VladimirNik <vladimir.nikolaev9@gmail.com> | 2014-01-07 03:48:43 +0400 |
commit | 68ba3efba997593ee24d1d72512ee4120b8fca6b (patch) | |
tree | 5b8a7744b20762f4b4fc79d1d39bae58899effcb /test/junit | |
parent | 2357e5dace20be5c7a2df94a7078b1c3bd4379db (diff) | |
download | scala-68ba3efba997593ee24d1d72512ee4120b8fca6b.tar.gz scala-68ba3efba997593ee24d1d72512ee4120b8fca6b.tar.bz2 scala-68ba3efba997593ee24d1d72512ee4120b8fca6b.zip |
Annotated trees processing is modified
1. Problem with multiple parameter lists in annotations is resolved
2. Tests for Annotated trees are added
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/reflect/internal/PrintersTest.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/junit/scala/reflect/internal/PrintersTest.scala b/test/junit/scala/reflect/internal/PrintersTest.scala index 08d1166ff7..06b7205612 100644 --- a/test/junit/scala/reflect/internal/PrintersTest.scala +++ b/test/junit/scala/reflect/internal/PrintersTest.scala @@ -692,6 +692,35 @@ trait ValAndDefPrintTests { @Test def testDefWithAnn4 = assertPrintedCode("@Foo(a)(b)(x, y) def foo = null") @Test def testDefWithAnn5 = assertPrintedCode("@Foo[A, B](a)(b) @Bar def foo(x: Int) = null") + + @Test def testDefWithAnn6 = assertPrintedCode("@test1(new test2()) def foo = 42") + + @Test def testDefWithAnn7 = assertPrintedCode("@`t*` def foo = 42") + + @Test def testDefWithAnn8 = assertPrintedCode("@throws(classOf[Exception]) def foo = throw new Exception()") + + @Test def testAnnotated1 = assertPrintedCode("def foo = 42: @test1") + + @Test def testAnnotated2 = assertPrintedCode("""def foo = 42: @test1(42, z = "5")""") + + @Test def testAnnotated3 = assertPrintedCode("def foo = (42: @test1): @test2(new test1())") + + @Test def testAnnotated4 = assertPrintedCode("""def foo = 42: @test1(4, "testing")(4.2)""") + + @Test def testAnnotated5 = assertPrintedCode("""def foo = (42: @test1(4, "testing")(4.2)): @test2(1, "bar")(3.14)""") + + @Test def testAnnotated6 = assertPrintedCode("def foo = ((42: @test1): @test2(new test1())): @test3(1)(2, 3)(4)") + + @Test def testAnnotated7 = assertPrintedCode(sm""" + |(x: @unchecked) match { + | case ((_): Int) => true + | case _ => false + |}""") + + @Test def testAnnotated8 = assertPrintedCode(sm""" + |((x: @unchecked): @test1(1, "testing")(3.14)) match { + | case _ => true + |}""") } trait PackagePrintTests { |