Skip to content

Commit

Permalink
Unused imports in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Jan 7, 2025
1 parent 030485a commit b96b125
Show file tree
Hide file tree
Showing 58 changed files with 30 additions and 148 deletions.
1 change: 0 additions & 1 deletion compiler/test/dotty/tools/AnnotationsTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import vulpix.TestConfiguration

import org.junit.Test

import dotc.ast.Trees._
import dotc.core.Decorators._
import dotc.core.Contexts._
import dotc.core.Phases._
Expand Down
3 changes: 1 addition & 2 deletions compiler/test/dotty/tools/DottyTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import vulpix.TestConfiguration
import dotc.core._
import dotc.core.Comments.{ContextDoc, ContextDocstrings}
import dotc.core.Contexts._
import dotc.core.Symbols._
import Types._, Symbols._, Decorators._
import Types._, Symbols._
import dotc.core.Decorators._
import dotc.ast.tpd
import dotc.Compiler
Expand Down
5 changes: 0 additions & 5 deletions compiler/test/dotty/tools/SignatureTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import vulpix.TestConfiguration
import org.junit.Assert._
import org.junit.Test

import dotc.ast.untpd
import dotc.core.Decorators._
import dotc.core.Contexts._
import dotc.core.Flags._
Expand All @@ -14,14 +13,10 @@ import dotc.core.Names._
import dotc.core.Types._
import dotc.core.Symbols._
import dotc.core.StdNames._
import dotc.core.Signature
import dotc.typer.ProtoTypes.constrained
import dotc.typer.Inferencing.isFullyDefined
import dotc.typer.ForceDegree
import dotc.util.NoSourcePosition

import java.io.File
import java.nio.file._

class SignatureTest:
@Test def signatureCaching: Unit =
Expand Down
1 change: 0 additions & 1 deletion compiler/test/dotty/tools/TestSources.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dotty.tools

import scala.language.unsafeNulls

import java.io.File
import java.nio.file._

import scala.jdk.CollectionConverters._
Expand Down
10 changes: 3 additions & 7 deletions compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ import vulpix.TestConfiguration

import dotc.core.Contexts.{Context, ContextBase, ctx}
import dotc.core.Comments.{ContextDoc, ContextDocstrings}
import dotc.core.Phases.Phase
import dotc.Compiler

import dotty.tools.io.{VirtualDirectory => Directory}
import scala.tools.asm
import asm._
import asm.tree._

import io.{AbstractFile, JavaClassPath, VirtualDirectory}
import io.{AbstractFile, VirtualDirectory}
import scala.jdk.CollectionConverters._
import scala.tools.asm.{ClassWriter, ClassReader}
import scala.tools.asm.ClassReader
import scala.tools.asm.tree._
import java.io.{File => JFile, InputStream}
import java.io.InputStream

import org.junit.Assert._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.junit.Assert._
import org.junit.Test

import scala.tools.asm
import asm._
import asm.tree._

import scala.tools.asm.Opcodes
Expand Down
1 change: 0 additions & 1 deletion compiler/test/dotty/tools/backend/jvm/IincTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dotty.tools.backend.jvm
import org.junit.Test
import org.junit.Assert._

import scala.tools.asm.Opcodes._

class IincTest extends DottyBytecodeTest {
import ASMConverters._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dotty.tools.backend.jvm

import scala.language.unsafeNulls

import org.junit.Assert._
import org.junit.Test

import scala.tools.asm.Opcodes._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ package dotty.tools.backend.jvm

import scala.language.unsafeNulls

import org.junit.Assert._
import org.junit.Test

import scala.tools.asm
import asm._
import asm.tree._

import scala.tools.asm.Opcodes
import scala.jdk.CollectionConverters._
import Opcodes._

class LabelBytecodeTests extends DottyBytecodeTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ package dotty.tools.backend.jvm

import scala.language.unsafeNulls

import org.junit.Assert._
import org.junit.Test

import scala.tools.asm
import asm._
import asm.tree._

import scala.tools.asm.Opcodes
Expand Down
4 changes: 0 additions & 4 deletions compiler/test/dotty/tools/backend/jvm/StringConcatTest.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package dotty.tools.backend.jvm

import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Test
import scala.tools.asm.Opcodes._
import org.junit.Assert._

import ASMConverters._


class StringConcatTest extends DottyBytecodeTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dotty.tools.backend.jvm

import org.junit.Assert._
import org.junit.Test

class StringInterpolatorOptTest extends DottyBytecodeTest {
Expand Down
1 change: 0 additions & 1 deletion compiler/test/dotty/tools/compilerSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import java.nio.file._
import java.net.URI
import scala.jdk.CollectionConverters._
import dotty.tools.dotc._
import core._
import core.Contexts._
import dotc.core.Comments.{ContextDoc, ContextDocstrings}

Expand Down
2 changes: 0 additions & 2 deletions compiler/test/dotty/tools/dotc/BestEffortOptionsTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ import java.io.{File => JFile}
import scala.language.unsafeNulls

class BestEffortOptionsTests {
import ParallelTesting._
import vulpix.TestConfiguration._
import BestEffortOptionsTests._
import CompilationTest.aggregateTests

// Since TASTy and beTASTy files are read in a lazy manner (only when referenced by the source .scala file)
// we test by using the "-from-tasty" option. This guarantees that the tasty files will be read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ package dotc

import scala.language.unsafeNulls

import org.junit.{ Test, BeforeClass, AfterClass }
import org.junit.Assert._
import org.junit.Assume._
import org.junit.{ Test, AfterClass }
import org.junit.experimental.categories.Category

import scala.concurrent.duration._
Expand Down
11 changes: 1 addition & 10 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,12 @@ package dotc

import scala.language.unsafeNulls

import org.junit.{ Test, BeforeClass, AfterClass, Ignore }
import org.junit.Assert._
import org.junit.{ Test, AfterClass }
import org.junit.Assume._
import org.junit.experimental.categories.Category

import java.io.File
import java.nio.file._
import java.util.stream.{ Stream => JStream }
import scala.jdk.CollectionConverters._
import scala.util.matching.Regex
import scala.concurrent.duration._
import TestSources.sources
import reporting.TestReporter
import vulpix._
import dotty.tools.dotc.config.ScalaSettings

class CompilationTests {
import ParallelTesting._
Expand Down
3 changes: 0 additions & 3 deletions compiler/test/dotty/tools/dotc/ConstantFoldingTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ package dotty.tools.dotc

import scala.language.unsafeNulls

import org.junit.Assert._
import org.junit.Test
import dotty.tools.backend.jvm._
import dotty.tools.dotc.config.CompilerCommand
import dotty.tools.dotc.core.Contexts.FreshContext
import scala.tools.asm.tree.MethodNode

import scala.jdk.CollectionConverters._
Expand Down
2 changes: 0 additions & 2 deletions compiler/test/dotty/tools/dotc/IdempotencyTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ package dotc
import scala.language.unsafeNulls

import java.io.{File => JFile}
import java.nio.file.{Files, Path, Paths}

import org.junit.Assume.assumeTrue
import org.junit.{AfterClass, Test}
import org.junit.experimental.categories.Category

Expand Down
2 changes: 0 additions & 2 deletions compiler/test/dotty/tools/dotc/SettingsTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import scala.language.unsafeNulls
import reporting.StoreReporter
import vulpix.TestConfiguration

import core.Contexts.{Context, ContextBase}
import dotty.tools.dotc.config.Settings.*
import dotty.tools.dotc.config.Settings.Setting.ChoiceWithHelp
import dotty.tools.dotc.config.ScalaSettingCategories.*
import dotty.tools.vulpix.TestConfiguration.mkClasspath
import dotty.tools.io.PlainDirectory
import dotty.tools.io.Directory
import dotty.tools.dotc.config.ScalaVersion
Expand Down
3 changes: 1 addition & 2 deletions compiler/test/dotty/tools/dotc/StringFormatterTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package dotty.tools
package dotc

import core.*, Contexts.*, Decorators.*, Denotations.*, Flags.*, Names.*, StdNames.*, SymDenotations.*, Symbols.*, Types.*
import core.*, Contexts.*, Decorators.*, Flags.*, Names.*, Symbols.*, Types.*
import config.Printers.*
import printing.Formatting.Show

import org.junit.Test
import org.junit.Assert.*
Expand Down
7 changes: 1 addition & 6 deletions compiler/test/dotty/tools/dotc/TastyBootstrapTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@ package dotc

import scala.language.unsafeNulls

import org.junit.{ Test, BeforeClass, AfterClass }
import org.junit.{ Test, AfterClass }
import org.junit.Assert._
import org.junit.Assume._
import org.junit.experimental.categories.Category

import java.io.File
import java.nio.file._
import java.util.stream.{ Stream => JStream }
import scala.jdk.CollectionConverters._
import scala.util.matching.Regex
import scala.concurrent.duration._
import TestSources.sources
import vulpix._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ScalaSettingsTests:
assertTrue("Has the feature", set.contains("dynamics"))

@Test def `WConf setting is parsed`: Unit =
import reporting.{Action, Diagnostic, NoExplanation}
import reporting.{Action, Diagnostic}
val sets = ScalaSettings
val args = List("-Wconf:cat=deprecation:s,cat=feature:e", "-Wconf:msg=a problem\\.:s")
val sumy = ArgsSummary(sets.defaultState, args, errors = Nil, warnings = Nil)
Expand Down Expand Up @@ -204,7 +204,6 @@ class ScalaSettingsTests:

private def wconfSrcFilterTest(argsStr: String,
warning: reporting.Diagnostic.Warning): Either[List[String], reporting.Action] =
import reporting.Diagnostic
val settings = ScalaSettings
val args = ArgsSummary(settings.defaultState, List(argsStr), errors = Nil, warnings = Nil)
val proc = settings.processArguments(args, processAll = true, skipped = Nil)
Expand Down
5 changes: 2 additions & 3 deletions compiler/test/dotty/tools/dotc/core/ConstraintsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ package dotc.core

import vulpix.TestConfiguration

import dotty.tools.dotc.core.Contexts.{*, given}
import dotty.tools.dotc.core.Decorators.{*, given}
import dotty.tools.dotc.core.Contexts.*
import dotty.tools.dotc.core.Decorators.*
import dotty.tools.dotc.core.Symbols.*
import dotty.tools.dotc.core.Types.*
import dotty.tools.dotc.ast.tpd.*
import dotty.tools.dotc.typer.ProtoTypes.constrained

import org.junit.Test

import dotty.tools.DottyTest

class ConstraintsTest:

Expand Down
3 changes: 1 addition & 2 deletions compiler/test/dotty/tools/dotc/core/ShowDecoratorTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package dotty.tools
package dotc
package core

import Contexts.*, Decorators.*, Denotations.*, SymDenotations.*, Symbols.*, Types.*
import printing.Formatting.Show
import Decorators.*

import org.junit.Test
import org.junit.Assert.*
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/dotc/core/TypeComparerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package dotty.tools
package dotc
package core

import Contexts.*, Decorators.*, Denotations.*, SymDenotations.*, Symbols.*, Types.*
import Decorators.*, Symbols.*, Types.*
import printing.Formatting.Show

import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import dotty.tools.dotc.{Driver, Main}
import dotty.tools.dotc.core.Comments.docCtx
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.core.Decorators.{toTermName, toTypeName}
import dotty.tools.dotc.core.Mode
import dotty.tools.dotc.core.Names.Name
import dotty.tools.dotc.interfaces.Diagnostic.ERROR
import dotty.tools.dotc.reporting.TestReporter
Expand Down
17 changes: 5 additions & 12 deletions compiler/test/dotty/tools/dotc/core/tasty/PathPicklingTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,18 @@ package dotty.tools.dotc.core.tasty

import scala.language.unsafeNulls

import java.io.{File => JFile, ByteArrayOutputStream, IOException}
import java.nio.file.{Files, NoSuchFileException, Paths}
import java.io.File => JFile
import java.nio.file.{Files, NoSuchFileException}

import scala.sys.process._

import org.junit.Test
import org.junit.Assert.{assertEquals, assertTrue, assertFalse, fail}
import org.junit.Assert.{assertTrue, assertFalse}

import dotty.tools.dotc.ast.tpd
import dotty.tools.dotc.ast.tpd.TreeOps
import dotty.tools.dotc.{Driver, Main}
import dotty.tools.dotc.decompiler
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.core.Decorators.{toTermName, toTypeName}
import dotty.tools.dotc.core.Mode
import dotty.tools.dotc.core.Names.Name
import dotty.tools.dotc.Main
import dotty.tools.dotc.interfaces.Diagnostic.ERROR
import dotty.tools.dotc.reporting.TestReporter
import dotty.tools.io.{Directory, File, Path, JarArchive}
import dotty.tools.io.{Path, JarArchive}

import dotty.tools.vulpix.TestConfiguration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package dotty.tools.dotc.core.tasty

import org.junit.Assert._
import org.junit.{Test, Ignore}
import org.junit.Test

import dotty.tools.tasty.TastyFormat._
import dotty.tools.tasty.TastyBuffer._
import dotty.tools.tasty.TastyBuffer
import dotty.tools.tasty.TastyReader
import dotty.tools.tasty.UnpickleException
Expand Down
2 changes: 0 additions & 2 deletions compiler/test/dotty/tools/dotc/coverage/CoverageTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ import org.junit.experimental.categories.Category
import dotty.{BootstrappedOnlyTests, Properties}
import dotty.tools.vulpix.*
import dotty.tools.vulpix.TestConfiguration.*
import dotty.tools.dotc.Main
import dotty.tools.dotc.reporting.TestReporter

import java.nio.file.{FileSystems, Files, Path, Paths, StandardCopyOption}
import scala.jdk.CollectionConverters.*
import scala.util.Properties.userDir
import scala.language.unsafeNulls
import scala.collection.mutable.Buffer
import dotty.tools.dotc.util.DiffUtil

import java.util.stream.Collectors

Expand Down
1 change: 0 additions & 1 deletion compiler/test/dotty/tools/dotc/parsing/DeSugarTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dotty.tools
package dotc
package parsing

import Tokens._, Parsers._
import core._
import ast.Trees._
import ast.desugar
Expand Down
Loading

0 comments on commit b96b125

Please sign in to comment.