Add some scala tests

This commit is contained in:
Clément Fournier
2020-03-20 10:45:48 +01:00
parent 89cddd8aa8
commit f36835638f
9 changed files with 2093 additions and 260 deletions

View File

@ -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")
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View 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]
}

View 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