Skip to content

Commit

Permalink
Add test for the issue #525
Browse files Browse the repository at this point in the history
  • Loading branch information
jchyb committed Jan 10, 2022
1 parent 75ba63e commit 2dc6225
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions modules/build/src/test/scala/scala/build/tests/BuildTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -775,4 +775,29 @@ class BuildTests extends munit.FunSuite {
assert(maybeBuild.toOption.get.options.scalaNativeOptions.linkingOptions.isEmpty)
}
}

// Issue #525
test("scalac options not spuriously duplicating") {
val inputs = TestInputs(
os.rel / "foo.scala" ->
"""// using scala "2.13"
|// using options "-deprecation", "-feature", "-Xmaxwarns", "1"
|// using option "-Xdisable-assertions"
|
|def foo = "bar"
|""".stripMargin
)

val buildOptions: BuildOptions = defaultOptions.copy(
internal = defaultOptions.internal.copy(
keepDiagnostics = true
)
)

inputs.withBuild(buildOptions, buildThreads, bloopConfig) { (_, _, maybeBuild) =>
val expectedOptions =
Seq("-deprecation", "-feature", "-Xmaxwarns", "1", "-Xdisable-assertions")
assert(maybeBuild.toOption.get.options.scalaOptions.scalacOptions == expectedOptions)
}
}
}

0 comments on commit 2dc6225

Please sign in to comment.