Skip to content

Commit

Permalink
Merge pull request #10712 from som-snytt/test/print-args
Browse files Browse the repository at this point in the history
Tweak test
  • Loading branch information
SethTisue committed Mar 27, 2024
2 parents 0630f6e + 68c5a27 commit 9681c8c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/files/run/print-args.scala
@@ -1,33 +1,33 @@
import java.nio.file.Files

import org.junit.Assert.assertFalse
import scala.jdk.CollectionConverters._
import scala.reflect.internal.util._
import scala.tools.partest.DirectTest
import scala.tools.testkit.AssertUtil.assertSameElements

import org.junit.Assert._

object Test extends DirectTest {
lazy val argfile = testOutput.jfile.toPath().resolve("print-args.txt")
override def extraSettings = s"${super.extraSettings} -Xsource:3 -Vprint-args ${argfile}"
override def extraSettings = s"${super.extraSettings} -Vprint-args ${argfile}"
def expected =
sm"""
|-usejavacp
|-d
|${testOutput.jfile.toPath()}
|-Xsource:3.0.0
|-Vprint-args
|${testOutput.jfile.toPath().resolve(argfile)}
|newSource1.scala
"""
""".trim
def code =
sm"""
|class C {
| def f: Int = "42"
|}
"""
def show() = {
assert(!compile())
//assertEquals(expected.linesIterator.toList, Files.readAllLines(argfile).asScala.toList)
assert(expected.linesIterator.toList.tail.init.sameElements(Files.readAllLines(argfile).asScala))
assertFalse(compile())
assertSameElements(expected.linesIterator, Files.readAllLines(argfile).asScala)
}
}

0 comments on commit 9681c8c

Please sign in to comment.