Skip to content

Commit 5638962

Browse files
committed
Add unsafeNulls imports to testing code
1 parent d543f4d commit 5638962

Some content is hidden

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

61 files changed

+135
-17
lines changed

compiler/test/debug/Gen.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import scala.language.unsafeNulls
2+
13
import scala.io.Source
24
import scala.collection.mutable.ListBuffer
35
import scala.util.Using

compiler/test/dotty/Properties.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty
22

3+
import scala.language.unsafeNulls
4+
35
import java.nio.file._
46

57
/** Runtime properties from defines or environmnent */

compiler/test/dotty/tools/DottyTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty
22
package tools
33

4+
import scala.language.unsafeNulls
5+
46
import vulpix.TestConfiguration
57

68
import dotc.core._

compiler/test/dotty/tools/DottyTypeStealer.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools
22

3+
import scala.language.unsafeNulls
4+
35
import dotc.ast.tpd
46
import dotc.ast.tpd._
57
import dotc.core.Contexts.{Context, atPhase}

compiler/test/dotty/tools/TestSources.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools
22

3+
import scala.language.unsafeNulls
4+
35
import java.io.File
46
import java.nio.file._
57

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.backend.jvm
22

3+
import scala.language.unsafeNulls
4+
35
import scala.tools.asm
46
import asm._
57
import asm.tree._

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.backend.jvm
22

3+
import scala.language.unsafeNulls
4+
35
import java.lang.reflect.Modifier
46
import scala.tools.asm
57
import asm._

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty
22
package tools
33
package backend.jvm
44

5+
import scala.language.unsafeNulls
6+
57
import vulpix.TestConfiguration
68

79
import dotc.core.Contexts.{Context, ContextBase, ctx}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.backend.jvm
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Assert._
46
import org.junit.Test
57

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.backend.jvm
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Assert._
46
import org.junit.Test
57

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class StringConcatTest extends DottyBytecodeTest {
122122
chsq: java.lang.CharSequence,
123123
chrs: Array[Char]) = {
124124
val s1 = str + obj + v + z + c + b + s + i + f + l + d + sbuf + chsq + chrs
125-
val s2 = String.valueOf(obj) + str + v + z + c + b + s + i + f + l + d + sbuf + chsq + chrs
125+
val s2 = String.valueOf(obj).nn + str + v + z + c + b + s + i + f + l + d + sbuf + chsq + chrs
126126
s1 + "//" + s2
127127
}
128128
def sbuf = { val r = new java.lang.StringBuffer(); r.append("sbuf"); r }

compiler/test/dotty/tools/compilerSupport.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools
22

3+
import scala.language.unsafeNulls
4+
35
import javax.tools._
46
import java.io._
57
import java.nio.file._

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty
22
package tools
33
package dotc
44

5+
import scala.language.unsafeNulls
6+
57
import org.junit.{ Test, BeforeClass, AfterClass }
68
import org.junit.Assert._
79
import org.junit.Assume._

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty
22
package tools
33
package dotc
44

5+
import scala.language.unsafeNulls
6+
57
import org.junit.{ Test, BeforeClass, AfterClass }
68
import org.junit.Assert._
79
import org.junit.Assume._

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Assert._
46
import org.junit.Test
57
import dotty.tools.backend.jvm._

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty
22
package tools
33
package dotc
44

5+
import scala.language.unsafeNulls
6+
57
import org.junit.{AfterClass, Test}
68
import vulpix._
79

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty
22
package tools
33
package dotc
44

5+
import scala.language.unsafeNulls
6+
57
import java.io.{File => JFile}
68
import java.nio.file.{Files, Path, Paths}
79

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty
22
package tools.dotc
33

4+
import scala.language.unsafeNulls
5+
46
import org.junit.Test
57
import org.junit.Assert._
68
import org.junit.experimental.categories.Category

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Test
46
import org.junit.Assert._
57
import org.junit.Rule

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty.tools
22
package dotc
33

4+
import scala.language.unsafeNulls
5+
46
import reporting.StoreReporter
57
import vulpix.TestConfiguration
68

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty
22
package tools
33
package dotc
44

5+
import scala.language.unsafeNulls
6+
57
import org.junit.{ Test, BeforeClass, AfterClass }
68
import org.junit.Assert._
79
import org.junit.Assume._

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TastyHashTest {
1919
testHash(0X202020202L, Array(2, 2, 2, 2, 2))
2020
testHash(0X1010101L, Array.fill(1024)(1))
2121
testHash(0xaafefeaaab54ffL, Array.tabulate(1024)(_.toByte))
22-
testHash(0x34545c16020230L, "abcdefghijklmnopqrstuvwxyz1234567890".getBytes)
22+
testHash(0x34545c16020230L, "abcdefghijklmnopqrstuvwxyz1234567890".getBytes.nn)
2323
}
2424

2525
def testHash(expected: Long, arr: Array[Byte]): Unit = {

compiler/test/dotty/tools/dotc/classpath/MultiReleaseJarTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc.classpath
22

3+
import scala.language.unsafeNulls
4+
35
import dotty.tools.dotc.core.Contexts.Context
46

57
import java.io.{ByteArrayOutputStream, IOException}

compiler/test/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactoryTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc.classpath
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Test
46
import java.nio.file._
57
import java.nio.file.attribute.FileTime

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
package dotty.tools.dotc.config
33

4+
import scala.language.unsafeNulls
5+
46
import org.junit.Assert.{assertEquals, assertTrue}
57
import org.junit.Test
68

compiler/test/dotty/tools/dotc/core/tasty/CommentPicklingTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc.core.tasty
22

3+
import scala.language.unsafeNulls
4+
35
import dotty.tools.dotc.ast.tpd
46
import dotty.tools.dotc.ast.tpd.TreeOps
57
import dotty.tools.dotc.{Driver, Main}

compiler/test/dotty/tools/dotc/core/tasty/PathPicklingTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc.core.tasty
22

3+
import scala.language.unsafeNulls
4+
35
import java.io.{File => JFile, ByteArrayOutputStream, IOException}
46
import java.nio.file.{Files, NoSuchFileException, Paths}
57

compiler/test/dotty/tools/dotc/plugins/PluginsTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc.plugins
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Test
46

57
import dotty.tools.dotc._

compiler/test/dotty/tools/dotc/printing/PrintingTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty
22
package tools
33
package dotc
44

5+
import scala.language.unsafeNulls
6+
57
import vulpix.FileDiff
68
import vulpix.TestConfiguration
79
import vulpix.TestConfiguration

compiler/test/dotty/tools/dotc/printing/SyntaxHighlightingTests.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc.printing
22

3+
import scala.language.unsafeNulls
4+
35
import dotty.tools.DottyTest
46
import org.junit.Assert._
57
import org.junit.{Ignore, Test}

compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty.tools
22
package dotc
33
package reporting
44

5+
import scala.language.unsafeNulls
6+
57
import core.Contexts.Context
68
import org.junit.Assert._
79

compiler/test/dotty/tools/dotc/reporting/TestReporter.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty.tools
22
package dotc
33
package reporting
44

5+
import scala.language.unsafeNulls
6+
57
import java.io.{ PrintStream, PrintWriter, File => JFile, FileOutputStream, StringWriter }
68
import java.text.SimpleDateFormat
79
import java.util.Date

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc.semanticdb
22

3+
import scala.language.unsafeNulls
4+
35
import java.net.URLClassLoader
46
import java.util.regex.Pattern
57
import java.io.File

compiler/test/dotty/tools/dotc/transform/PatmatExhaustivityTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package tools
33
package dotc
44
package transform
55

6+
import scala.language.unsafeNulls
7+
68
import vulpix.FileDiff
79
import vulpix.TestConfiguration
810
import reporting.TestReporter
@@ -33,7 +35,7 @@ class PatmatExhaustivityTest {
3335
e.printStackTrace(printWriter)
3436
}
3537

36-
stringBuffer.toString.trim.replaceAll("\\s+\n", "\n") match {
38+
stringBuffer.toString.trim.nn.replaceAll("\\s+\n", "\n") match {
3739
case "" => Nil
3840
case s => s.linesIterator.toSeq
3941
}

compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package dotty.tools
22
package dotc
33
package transform
44

5+
import scala.language.unsafeNulls
6+
57
import org.junit.Test
68

79
import dotty.tools.backend.jvm.DottyBytecodeTest

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.dotc.util
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Assert._
46
import org.junit.Test
57

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
package dotty.tools.dotc.util
33

4+
import scala.language.unsafeNulls
5+
46
import scala.util.{Failure, Success, Try}
57
import scala.util.chaining.given
68

compiler/test/dotty/tools/io/AbstractFileTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.io
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Test
46

57
import dotty.tools.io.AbstractFile

compiler/test/dotty/tools/io/ClasspathTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.io
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Test
46

57
import java.io.File
@@ -29,9 +31,9 @@ class ClasspathTest {
2931
for src <- libjarFiles do
3032
val dest = Paths.get(s"$outDir/${src.getName}")
3133
printf("copy: %s\n", Files.copy(src.toPath, dest))
32-
34+
3335
val cp = Seq(s"$outDir/*", "not-a-real-directory/*").mkString(pathsep).replace('\\', '/')
34-
36+
3537
val libjars = libjarFiles.map { _.getName }.toSet
3638

3739
// expand wildcard classpath entries, ignoring invalid entries

compiler/test/dotty/tools/io/ZipArchiveTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.io
22

3+
import scala.language.unsafeNulls
4+
35
import java.io.IOException
46
import java.net.{URI, URL, URLClassLoader}
57
import java.nio.file.{Files, Path, Paths}

compiler/test/dotty/tools/repl/AbstractFileClassLoaderTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.repl
22

3+
import scala.language.unsafeNulls
4+
35
import org.junit.Assert.*
46
import org.junit.Test
57

compiler/test/dotty/tools/repl/DocTests.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty.tools
22
package repl
33

4+
import scala.language.unsafeNulls
5+
46
import org.junit.Test
57
import org.junit.Assert.assertEquals
68

compiler/test/dotty/tools/repl/LoadTests.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.repl
22

3+
import scala.language.unsafeNulls
4+
35
import java.nio.file.{Path, Files}
46
import java.util.Comparator
57
import java.util.regex.Pattern

compiler/test/dotty/tools/repl/ReplCompilerTests.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dotty.tools.repl
22

3+
import scala.language.unsafeNulls
4+
35
import java.util.regex.Pattern
46

57
import org.junit.Assert.{assertTrue => assert, _}

compiler/test/dotty/tools/repl/ReplTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dotty.tools
22
package repl
33

4+
import scala.language.unsafeNulls
5+
46
import vulpix.TestConfiguration
57
import vulpix.FileDiff
68

0 commit comments

Comments
 (0)