-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #383 from eed3si9n/wip/conflict_warning
Fix cross-Scala suffix conflict warning
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
ivy/src/test/scala/sbt/internal/librarymanagement/ConflictWarningSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package sbt.internal.librarymanagement | ||
|
||
import sbt.librarymanagement._ | ||
import sbt.librarymanagement.syntax._ | ||
|
||
object ConflictWarningSpec extends BaseIvySpecification { | ||
|
||
test("it should print out message about the cross-Scala conflict") { | ||
var found = false | ||
val deps = Vector( | ||
`scala2.13.6`, | ||
`cats-effect3.1.1`, | ||
`cats-core2.6.1`.cross(CrossVersion.for3Use2_13), | ||
) | ||
val m = module(defaultModuleId, deps, Some("3.0.1-RC2")) | ||
val report = ivyUpdate(m) | ||
val w = ConflictWarning.default("foo") | ||
|
||
try { | ||
ConflictWarning(w, report, log) | ||
} catch { | ||
case e: Throwable => | ||
found = true | ||
assert( | ||
e.getMessage.linesIterator.toList.head | ||
.startsWith("Conflicting cross-version suffixes in") | ||
) | ||
} | ||
if (!found) { | ||
sys.error("conflict warning was expected, but didn't happen sbt/sbt#6578") | ||
} | ||
} | ||
|
||
lazy val `scala2.13.6` = | ||
ModuleID("org.scala-lang", "scala-library", "2.13.6").withConfigurations(Some("compile")) | ||
lazy val `cats-effect3.1.1` = | ||
("org.typelevel" %% "cats-effect" % "3.1.1").withConfigurations(Some("compile")) | ||
lazy val `cats-core2.6.1` = | ||
("org.typelevel" %% "cats-core" % "2.6.1").withConfigurations(Some("compile")) | ||
} |