Add some scala tests
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.scala.ast
|
||||
|
||||
import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper
|
||||
import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest
|
||||
import net.sourceforge.pmd.lang.ast.test.SimpleNodePrinter
|
||||
import org.junit.Test
|
||||
|
||||
class ScalaParserTests : BaseTreeDumpTest(SimpleNodePrinter, ".scala") {
|
||||
|
||||
override val parser: BaseParsingHelper<*, *>
|
||||
get() = ScalaParsingHelper.DEFAULT.withResourceContext(javaClass, "testdata")
|
||||
|
||||
@Test
|
||||
fun testSomeScalaFeatures() = doTest("List")
|
||||
|
||||
@Test
|
||||
fun testPackageObject() = doTest("package")
|
||||
|
||||
}
|
324
pmd-scala/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/List.scala
vendored
Normal file
324
pmd-scala/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/List.scala
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1634
pmd-scala/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/List.txt
vendored
Normal file
1634
pmd-scala/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/List.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
pmd-scala/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/package.scala
vendored
Normal file
22
pmd-scala/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/package.scala
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package scala.collection
|
||||
|
||||
|
||||
package object immutable {
|
||||
type StringOps = scala.collection.StringOps
|
||||
val StringOps = scala.collection.StringOps
|
||||
type StringView = scala.collection.StringView
|
||||
val StringView = scala.collection.StringView
|
||||
|
||||
@deprecated("Use Iterable instead of Traversable", "2.13.0")
|
||||
type Traversable[+X] = Iterable[X]
|
||||
@deprecated("Use Iterable instead of Traversable", "2.13.0")
|
||||
val Traversable = Iterable
|
||||
|
||||
@deprecated("Use Map instead of DefaultMap", "2.13.0")
|
||||
type DefaultMap[K, +V] = scala.collection.immutable.Map[K, V]
|
||||
}
|
90
pmd-scala/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/package.txt
vendored
Normal file
90
pmd-scala/src/test/resources/net/sourceforge/pmd/lang/scala/ast/testdata/package.txt
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
└─ Source
|
||||
└─ Pkg
|
||||
├─ TermSelect
|
||||
│ ├─ TermName
|
||||
│ └─ TermName
|
||||
└─ PkgObject
|
||||
├─ TermName
|
||||
└─ Template
|
||||
├─ Self
|
||||
│ └─ NameAnonymous
|
||||
├─ DefnType
|
||||
│ ├─ TypeName
|
||||
│ └─ TypeSelect
|
||||
│ ├─ TermSelect
|
||||
│ │ ├─ TermName
|
||||
│ │ └─ TermName
|
||||
│ └─ TypeName
|
||||
├─ DefnVal
|
||||
│ ├─ PatVar
|
||||
│ │ └─ TermName
|
||||
│ └─ TermSelect
|
||||
│ ├─ TermSelect
|
||||
│ │ ├─ TermName
|
||||
│ │ └─ TermName
|
||||
│ └─ TermName
|
||||
├─ DefnType
|
||||
│ ├─ TypeName
|
||||
│ └─ TypeSelect
|
||||
│ ├─ TermSelect
|
||||
│ │ ├─ TermName
|
||||
│ │ └─ TermName
|
||||
│ └─ TypeName
|
||||
├─ DefnVal
|
||||
│ ├─ PatVar
|
||||
│ │ └─ TermName
|
||||
│ └─ TermSelect
|
||||
│ ├─ TermSelect
|
||||
│ │ ├─ TermName
|
||||
│ │ └─ TermName
|
||||
│ └─ TermName
|
||||
├─ DefnType
|
||||
│ ├─ ModAnnot
|
||||
│ │ └─ Init
|
||||
│ │ ├─ TypeName
|
||||
│ │ ├─ NameAnonymous
|
||||
│ │ ├─ LitString
|
||||
│ │ └─ LitString
|
||||
│ ├─ TypeName
|
||||
│ ├─ TypeParam
|
||||
│ │ ├─ ModCovariant
|
||||
│ │ ├─ TypeName
|
||||
│ │ └─ TypeBounds
|
||||
│ └─ TypeApply
|
||||
│ ├─ TypeName
|
||||
│ └─ TypeName
|
||||
├─ DefnVal
|
||||
│ ├─ ModAnnot
|
||||
│ │ └─ Init
|
||||
│ │ ├─ TypeName
|
||||
│ │ ├─ NameAnonymous
|
||||
│ │ ├─ LitString
|
||||
│ │ └─ LitString
|
||||
│ ├─ PatVar
|
||||
│ │ └─ TermName
|
||||
│ └─ TermName
|
||||
└─ DefnType
|
||||
├─ ModAnnot
|
||||
│ └─ Init
|
||||
│ ├─ TypeName
|
||||
│ ├─ NameAnonymous
|
||||
│ ├─ LitString
|
||||
│ └─ LitString
|
||||
├─ TypeName
|
||||
├─ TypeParam
|
||||
│ ├─ TypeName
|
||||
│ └─ TypeBounds
|
||||
├─ TypeParam
|
||||
│ ├─ ModCovariant
|
||||
│ ├─ TypeName
|
||||
│ └─ TypeBounds
|
||||
└─ TypeApply
|
||||
├─ TypeSelect
|
||||
│ ├─ TermSelect
|
||||
│ │ ├─ TermSelect
|
||||
│ │ │ ├─ TermName
|
||||
│ │ │ └─ TermName
|
||||
│ │ └─ TermName
|
||||
│ └─ TypeName
|
||||
├─ TypeName
|
||||
└─ TypeName
|
Reference in New Issue
Block a user