Skip to content

Commit 7939932

Browse files
committed
Change colon to with in tests
1 parent a13b014 commit 7939932

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+98
-98
lines changed

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.junit.{Ignore, Test}
77
import org.junit.Assert.{assertEquals, fail}
88
import org.junit.experimental.categories.Category
99

10-
abstract class CommunityBuildTest:
10+
abstract class CommunityBuildTest with
1111
given CommunityBuildTest = this
1212

1313
/** Depending on the mode of operation, either
@@ -81,7 +81,7 @@ abstract class CommunityBuildTest:
8181
end CommunityBuildTest
8282

8383
@Category(Array(classOf[TestCategory]))
84-
class CommunityBuildTestA extends CommunityBuildTest:
84+
class CommunityBuildTestA extends CommunityBuildTest with
8585
@Test def endpoints4s = projects.endpoints4s.run()
8686
@Test def fansi = projects.fansi.run()
8787
@Test def fastparse = projects.fastparse.run()
@@ -119,7 +119,7 @@ class CommunityBuildTestA extends CommunityBuildTest:
119119
end CommunityBuildTestA
120120

121121
@Category(Array(classOf[TestCategory]))
122-
class CommunityBuildTestB extends CommunityBuildTest:
122+
class CommunityBuildTestB extends CommunityBuildTest with
123123
@Test def algebra = projects.algebra.run()
124124
@Test def betterfiles = projects.betterfiles.run()
125125
@Test def cats = projects.cats.run()

compiler/test/dotty/tools/AnnotationsTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import dotc.core.Symbols._
1414
import java.io.File
1515
import java.nio.file._
1616

17-
class AnnotationsTest:
17+
class AnnotationsTest with
1818

1919
@Test def annotTreeNotErased: Unit =
2020
withJavaCompiled(

compiler/test/dotty/tools/SignatureTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import dotc.core.Symbols._
1414
import java.io.File
1515
import java.nio.file._
1616

17-
class SignatureTest:
17+
class SignatureTest with
1818
@Test def signatureCaching: Unit =
1919
inCompilerContext(TestConfiguration.basicClasspath, separateRun = true, "case class Foo(value: Unit)") {
2020
val (ref, refSig) = atPhase(erasurePhase.next) {

compiler/test/dotty/tools/backend/jvm/InlineBytecodeTests.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
411411
}
412412

413413
@Test def i6375 = {
414-
val source = """class Test:
414+
val source = """class Test with
415415
| given Int = 0
416416
| def f(): Int ?=> Boolean = true : (Int ?=> Boolean)
417417
| transparent inline def g(): Int ?=> Boolean = true
@@ -440,7 +440,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
440440
}
441441

442442
@Test def i6800a = {
443-
val source = """class Foo:
443+
val source = """class Foo with
444444
| inline def inlined(f: => Unit): Unit = f
445445
| def test: Unit = inlined { println("") }
446446
""".stripMargin
@@ -459,7 +459,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
459459
}
460460

461461
@Test def i6800b = {
462-
val source = """class Foo:
462+
val source = """class Foo with
463463
| inline def printIfZero(x: Int): Unit = inline x match
464464
| case 0 => println("zero")
465465
| case _ => ()
@@ -485,7 +485,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
485485

486486

487487
@Test def i9246 = {
488-
val source = """class Foo:
488+
val source = """class Foo with
489489
| inline def check(v:Double): Unit = if(v==0) throw new Exception()
490490
| inline def divide(v: Double, d: Double): Double = { check(d); v / d }
491491
| def test = divide(10,2)
@@ -504,7 +504,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
504504
}
505505

506506
@Test def finalVals = {
507-
val source = """class Test:
507+
val source = """class Test with
508508
| final val a = 1 // should be inlined but not erased
509509
| inline val b = 2 // should be inlined and erased
510510
| def test: Int = a + b
@@ -527,7 +527,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
527527

528528

529529
@Test def i9466 = {
530-
val source = """class Test:
530+
val source = """class Test with
531531
| inline def i(inline f: Int => Boolean): String =
532532
| if f(34) then "a"
533533
| else "b"
@@ -553,7 +553,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
553553
}
554554

555555
@Test def beta_reduce_under_block = {
556-
val source = """class Test:
556+
val source = """class Test with
557557
| def test =
558558
| {
559559
| val a = 3

compiler/test/dotty/tools/dotc/SettingsTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class SettingsTests {
4141
assertEquals(1, reporter.errorCount)
4242

4343
@Test def acceptUnconstrained: Unit =
44-
object Settings extends SettingGroup:
44+
object Settings extends SettingGroup with
4545
val foo = StringSetting("-foo", "foo", "Foo", "a")
4646
val bar = IntSetting("-bar", "Bar", 0)
4747

@@ -54,7 +54,7 @@ class SettingsTests {
5454
}
5555

5656
@Test def validateChoices: Unit =
57-
object Settings extends SettingGroup:
57+
object Settings extends SettingGroup with
5858
val foo = ChoiceSetting("-foo", "foo", "Foo", List("a", "b"), "a")
5959
val bar = IntChoiceSetting("-bar", "Bar", List(0, 1, 2), 0)
6060
val baz = IntChoiceSetting("-baz", "Baz", 0 to 10, 10)

compiler/test/dotty/tools/dotc/config/CommandLineParserTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package dotty.tools.dotc.config
44
import org.junit.Assert.{assertEquals, assertTrue}
55
import org.junit.Test
66

7-
class CommandLineParserTest:
7+
class CommandLineParserTest with
88
import CommandLineParser.{tokenize, ParseException}
99

1010
private def check(tokens: String*)(input: String): Unit = assertEquals(tokens, tokenize(input))

compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import Settings._
77
import org.junit.Test
88
import org.junit.Assert._
99

10-
class ScalaSettingsTests:
10+
class ScalaSettingsTests with
1111

1212
@Test def `A setting with aliases is accepted`: Unit =
13-
class MySettings extends SettingGroup:
13+
class MySettings extends SettingGroup with
1414
val classpath: Setting[String] = PathSetting("-classpath", "Specify where to find user class files.", ".", aliases = List("--class-path", "-cp"))
1515
val settings = MySettings()
1616
val args = tokenize("-cp path/to/classes1:other/path/to/classes2")
@@ -23,7 +23,7 @@ class ScalaSettingsTests:
2323
assertTrue("wrong classpath", classpath == "path/to/classes1:other/path/to/classes2")
2424

2525
@Test def `A multistring setting is multivalued`: Unit =
26-
class SUT extends SettingGroup:
26+
class SUT extends SettingGroup with
2727
val language: Setting[List[String]] = MultiStringSetting("-language", "feature", "Enable one or more language features.")
2828
val sut = SUT()
2929
val args = tokenize("-language:implicitConversions,dynamics")
@@ -37,7 +37,7 @@ class ScalaSettingsTests:
3737
assertTrue("Has the feature", set.contains("dynamics"))
3838

3939
@Test def `t9719 Apply -language more than once`: Unit =
40-
class SUT extends SettingGroup:
40+
class SUT extends SettingGroup with
4141
val language: Setting[List[String]] = MultiStringSetting("-language", "feature", "Enable one or more language features.")
4242
val sut = SUT()
4343
val args = tokenize("-language:implicitConversions -language:dynamics")
@@ -51,7 +51,7 @@ class ScalaSettingsTests:
5151
assertTrue("Has the feature", set.contains("dynamics"))
5252

5353
@Test def `Warn if multistring element is supplied multiply`: Unit =
54-
class SUT extends SettingGroup:
54+
class SUT extends SettingGroup with
5555
val language: Setting[List[String]] = MultiStringSetting("-language", "feature", "Enable one or more language features.")
5656
val sut = SUT()
5757
val args = tokenize("-language:dynamics -language:implicitConversions -language:dynamics")

compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import dotty.tools.dotc.util.SourceFile
2626
SemanticdbTests().runExpectTest(updateExpectFiles = true)
2727

2828
@Category(Array(classOf[BootstrappedOnlyTests]))
29-
class SemanticdbTests:
29+
class SemanticdbTests with
3030
val javaFile = FileSystems.getDefault.getPathMatcher("glob:**.java")
3131
val scalaFile = FileSystems.getDefault.getPathMatcher("glob:**.scala")
3232
val expectFile = FileSystems.getDefault.getPathMatcher("glob:**.expect.scala")
@@ -124,7 +124,7 @@ class SemanticdbTests:
124124

125125
end SemanticdbTests
126126

127-
object SemanticdbTests:
127+
object SemanticdbTests with
128128
/** Prettyprint a text document with symbol occurrences next to each resolved identifier.
129129
*
130130
* Useful for testing purposes to ensure that SymbolOccurrence values make sense and are correct.

compiler/test/dotty/tools/dotc/util/StackTraceTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import scala.util.chaining.given
77
import org.junit.Assert.{assertEquals, assertTrue}
88
import org.junit.Test
99

10-
class StackTraceTest:
10+
class StackTraceTest with
1111
val CausedBy = "Caused by: "
1212
val Suppressed = "Suppressed: "
1313

compiler/test/dotty/tools/scripting/ScriptingTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import vulpix.TestConfiguration
1010

1111

1212
/** Runs all tests contained in `compiler/test-resources/repl/` */
13-
class ScriptingTests:
13+
class ScriptingTests with
1414
extension (str: String) def dropExtension =
1515
str.reverse.dropWhile(_ != '.').drop(1).reverse
1616

scala3doc-testcases/src/tests/FilterTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package tests
22

3-
trait FilterTestBaseTrait:
3+
trait FilterTestBaseTrait with
44
/** doc */
55
protected def protectetDefInheriteTrait(a: Int): String = ???
66
/** doc */
@@ -20,7 +20,7 @@ trait FilterTestBaseTrait:
2020
/** doc */
2121
val publicValInheritedTrait = 567
2222

23-
class FilterTestBase:
23+
class FilterTestBase with
2424
/** doc */
2525
sealed abstract class BInherited
2626
/** doc */
@@ -69,7 +69,7 @@ class FilterTestBase:
6969
/** doc */
7070
given namedMap: Map[String, Double] = Map.empty
7171

72-
class FilterTest extends FilterTestBase with FilterTestBaseTrait:
72+
class FilterTest extends FilterTestBase with FilterTestBaseTrait with
7373
/** doc */
7474
sealed abstract class B
7575
/** doc */

scala3doc-testcases/src/tests/complexNames.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package tests
22

33
package complexNames
44

5-
abstract class A:
5+
abstract class A with
66
def ++(other: A): A
77
def +:(other: Int): A
88
def :+(other: Int): A
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package tests
2-
package deprecated
2+
package deprecated
33

4-
class A:
4+
class A with
55
def defInt: Int = 1
66
@deprecated(message = "1")
77
def def1: 1 = 1
@@ -10,10 +10,10 @@ class A:
1010
val val1: 1 = 1
1111
var varInt: Int = 1
1212
var var1: 1 = 1
13-
class InnerA:
13+
class InnerA with
1414
val innerVal: Int = 1
1515

16-
class B extends A:
16+
class B extends A with
1717
@deprecated(since = "1", message = "some reason")
1818
def x: Int = 1
1919
val y: Int = 1

scala3doc-testcases/src/tests/enumSignatures.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ enum Enum1
88
case B
99
case C
1010
}
11-
enum Enum2(val i: Int):
11+
enum Enum2(val i: Int) with
1212
case A(val s: String) extends Enum2(1)
1313
case B(val t: String) extends Enum2(2)
1414
case C(val u: String) extends Enum2(3)
1515

16-
enum Enum3(val param: Int):
16+
enum Enum3(val param: Int) with
1717
case A extends Enum3(1) with A
1818
case B extends Enum3(2)
1919
case C extends Enum3(3)
2020

21-
enum Enum4[+T]:
21+
enum Enum4[+T] with
2222
case G(s: String)
2323
case B extends Enum4[Int] with A
2424
case C[V](s:String) extends Enum4[V]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
package tests
2-
package exports
2+
package exports
33

4-
class A:
4+
class A with
55
def aDefInt: Int = 1
66
def aDef1: 1 = 1
77
val aValInt: Int = 1
88
val aVal1: 1 = 1
99
var aVarInt: Int = 1
1010
var aVar1: 1 = 1
1111

12-
object X:
12+
object X with
1313
def xDefInt: Int = 1
1414
def xDef1: 1 = 1
1515
val xValInt: Int = 1
1616
val xVal1: 1 = 1
1717
var xVarInt: Int = 1
1818
var xVar1: 1 = 1
1919

20-
class B:
20+
class B with
2121
val a = new A
2222
export a._
2323
export X._

scala3doc-testcases/src/tests/functionDRI.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ def b(b: B) = 3
1818
// @targetName("c_b") def c(p: Seq[B]) = 7
1919

2020
// scala3 doc right now is not differentiating between fields and nested classlikes
21-
// class C(val b: Int):
21+
// class C(val b: Int) with
2222
// trait b
2323

24-
class D:
25-
trait b:
24+
class D with
25+
trait b with
2626
def b = 8
2727
def b = 9
2828

29-
class E:
30-
class F:
29+
class E with
30+
class F with
3131
def b = 10
32-
object F:
32+
object F with
3333
def b = 11

scala3doc-testcases/src/tests/genericMethods.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package tests.genericMethods
22

3-
class Types:
3+
class Types with
44
def orTypes(base: Int | String, nested: List[Int | Double] | Seq[String]): Unit
55
= ???
66
def andTypes(base: Int & String, nested: List[Int & Double] & Seq[String]): Unit

scala3doc-testcases/src/tests/givenDRI.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ given A[C] with {}
2020

2121
given [S <: C]: A[S] with {}
2222

23-
class R:
23+
class R with
2424
def a = 1
2525

2626
given RR: A[Int] with
2727
def a = 2
2828

29-
class S:
30-
class R:
29+
class S with
30+
class R with
3131
def a = 3
3232

3333
given R: A[Int] with

scala3doc-testcases/src/tests/implicitMembers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package tests
22

33
package implicitMembers
44

5-
class OuterClass:
5+
class OuterClass with
66
class ImplicitMemberTarget
77

8-
object ImplicitMemberTarget:
8+
object ImplicitMemberTarget with
99
extension (a: ImplicitMemberTarget)
1010
def extensionFromCompanion: String =
1111
"ImplicitMemberTarget"

scala3doc-testcases/src/tests/links.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package tests.links
22

3-
object AnObject:
3+
object AnObject with
44
def method(a: Int): Int
55
= 123 + a
66
val field =
@@ -11,6 +11,6 @@ object AnObject:
1111
* [[tests.links.AnObject]]
1212
1313
*/
14-
class LinksTest:
14+
class LinksTest with
1515
def verifyIfLinksTestIsGenerated(b: Int): Int
1616
= 123

0 commit comments

Comments
 (0)