File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
main/scala/org/scalasteward/core/edit/update/data
test/scala/org/scalasteward/core/edit Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ object Substring {
4444 def applyAll (replacements : List [Replacement ])(source : String ): String = {
4545 var start = 0
4646 val sb = new java.lang.StringBuilder (source.length)
47- replacements.sortBy(_.position.start).foreach { r =>
47+ replacements.distinctBy(_.position.start). sortBy(_.position.start).foreach { r =>
4848 val before = source.substring(start, r.position.start)
4949 start = r.position.start + r.position.value.length
5050 sb.append(before).append(r.replacement)
Original file line number Diff line number Diff line change @@ -431,6 +431,17 @@ class RewriteTest extends FunSuite {
431431 runApplyUpdate(update, original, expected)
432432 }
433433
434+ // https://github.com/scala-steward-org/scala-steward/pull/3016
435+ test(" artifact change with multiple artifactId cross names" ) {
436+ val update = (" com.pauldijou" .g % Nel .of(
437+ (" jwt-core" , " jwt-core_2.12" ).a,
438+ (" jwt-core" , " jwt-core_2.13" ).a
439+ ) % " 5.0.0" %> " 9.2.0" ).single.copy(newerGroupId = Some (" com.github.jwt-scala" .g))
440+ val original = Map (" build.sbt" -> """ "com.pauldijou" %% "jwt-core" % "5.0.0" """ )
441+ val expected = Map (" build.sbt" -> """ "com.github.jwt-scala" %% "jwt-core" % "9.2.0" """ )
442+ runApplyUpdate(update, original, expected)
443+ }
444+
434445 // https://github.com/scala-steward-org/scala-steward/pull/566
435446 test(" prevent exception: named capturing group is missing trailing '}'" ) {
436447 val update =
You can’t perform that action at this time.
0 commit comments