Skip to content

Commit

Permalink
run more expect tests against Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
bjaglin committed Mar 3, 2024
1 parent c1d8a34 commit 06015e8
Show file tree
Hide file tree
Showing 41 changed files with 35 additions and 42 deletions.
28 changes: 0 additions & 28 deletions scalafix-tests/input/src/main/scala-2/test/AnchorPatches.scala

This file was deleted.

24 changes: 24 additions & 0 deletions scalafix-tests/input/src/main/scala/test/AnchorPatches.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
rule = [RemoveUnused]
*/
package test

import scala.collection.AbstractMap
import scala.collection.immutable // scalafix:ok RemoveUnusedImports

import scala.collection.mutable.{ // scalafix:ok RemoveUnusedImports
Map,
Set
}

import scala.collection.mutable.{
Map,
Set
}

import scala.concurrent.duration.Duration

object AnchorPatches {
private def d1s = Duration(1, "s")
private def d2s = Duration(2, "s") // scalafix:ok RemoveUnused
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Disable.symbols = [

package test.escapeHatch

import test.disableSyntax.DisableSyntaxMoreRules.toString

object AnchorExpression {

val aDummy = 0 // assert: NoDummy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Disable.symbols = [

package test.escapeHatch

import test.disableSyntax.DisableSyntaxMoreRules.toString

object AnchorMultipleRules {

// scalafix:off Disable.None, Disable.get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ object AnnotationScopes {

class Foo_0[DummyTypeParam] // assert: NoDummy

def dummyMacro_0: Unit = macro ??? // assert: NoDummy

class DummyClass_0( // assert: NoDummy
val aDummy: Int, // assert: NoDummy
val bDummy: Int) { // assert: NoDummy
Expand All @@ -35,7 +33,7 @@ object AnnotationScopes {
var dDummy = 0 // assert: NoDummy

def this(eDummy: String, // assert: NoDummy
fDummy: String) { // assert: NoDummy
fDummy: String) = { // assert: NoDummy
this(eDummy.toInt, fDummy.toInt) // assert: NoDummy
}

Expand Down Expand Up @@ -70,10 +68,6 @@ object AnnotationScopes {
// Type parameter
class Foo_1[@SuppressWarnings(Array("NoDummy")) DummyTypeParam]

// Macro
@SuppressWarnings(Array("NoDummy"))
def dummyMacro_1: Unit = macro ???

// Object
@SuppressWarnings(Array("NoDummy"))
object DummyObject_1 {
Expand Down Expand Up @@ -110,17 +104,17 @@ object AnnotationScopes {
class DummyClass_5 { // assert: NoDummy

@SuppressWarnings(Array("NoDummy"))
def this(eDummy: String, fDummy: String) {
this
def this(eDummy: String, fDummy: String) = {
this()
}
}

// Secondary constructor parameter
class DummyClass_6 { // assert: NoDummy

def this(@SuppressWarnings(Array("NoDummy")) eDummy: String,
fDummy: String) { // assert: NoDummy
this
fDummy: String) = { // assert: NoDummy
this()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import scala.collection.mutable.{ // scalafix:ok RemoveUnusedImports


import scala.concurrent.duration.Duration
import scala.concurrent.duration.FiniteDuration

object AnchorPatches {
def d1s: FiniteDuration = Duration(1, "s")
def d2s = Duration(2, "s") // scalafix:ok ExplicitResultTypes

private def d2s = Duration(2, "s") // scalafix:ok RemoveUnused
}

0 comments on commit 06015e8

Please sign in to comment.