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 {
44
44
def applyAll (replacements : List [Replacement ])(source : String ): String = {
45
45
var start = 0
46
46
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 =>
48
48
val before = source.substring(start, r.position.start)
49
49
start = r.position.start + r.position.value.length
50
50
sb.append(before).append(r.replacement)
Original file line number Diff line number Diff line change @@ -431,6 +431,17 @@ class RewriteTest extends FunSuite {
431
431
runApplyUpdate(update, original, expected)
432
432
}
433
433
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
+
434
445
// https://github.com/scala-steward-org/scala-steward/pull/566
435
446
test(" prevent exception: named capturing group is missing trailing '}'" ) {
436
447
val update =
You can’t perform that action at this time.
0 commit comments