Skip to content

Commit

Permalink
Add test to verify ScalacOptions.default is sane
Browse files Browse the repository at this point in the history
This is to prevent bugs like the one introduced in
typelevel#131, which causes
ScalacOptions.default contains a null value.
  • Loading branch information
lenguyenthanh committed Aug 16, 2024
1 parent 667098e commit 9a7ad11
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,15 @@ class ScalacOptionSuite extends munit.ScalaCheckSuite {
)
}
}

property("ScalacOptions.default should not contain null") {
forAll(versionGen, versionGen, versionGen) {
(currentMaj: Long, currentMin: Long, currentPatch: Long) =>
val version = ScalaVersion(currentMaj, currentMin, currentPatch)
ScalacOptions.default.foreach { option =>
assert(option.isSupported(version) || true)
}
}
}

}

0 comments on commit 9a7ad11

Please sign in to comment.