Skip to content

Commit c237dee

Browse files
committed
Issue #2877: Test to reproduce issue
1 parent 2ff8951 commit c237dee

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

modules/core/src/test/scala/org/scalasteward/core/edit/RewriteTest.scala

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,31 @@ class RewriteTest extends FunSuite {
840840
runApplyUpdate(update, original, expected)
841841
}
842842

843+
test("issue-2877: sbt using same version in a val and a literal".fail) {
844+
val update = ("org.scalatest".g % "scalatest".a % "3.2.13" %> "3.2.14").single
845+
val original = Map(
846+
"build.sbt" ->
847+
"""
848+
|val ScalaTestVersion = "3.2.13"
849+
|libraryDependencies ++= Seq(
850+
| "org.scalatest" %% "scalatest" % ScalaTestVersion,
851+
| "org.scalatest" %% "scalactic" % "3.2.13"
852+
|)
853+
|""".stripMargin
854+
)
855+
val expected = Map(
856+
"build.sbt" ->
857+
"""
858+
|val ScalaTestVersion = "3.2.14"
859+
|libraryDependencies ++= Seq(
860+
| "org.scalatest" %% "scalatest" % ScalaTestVersion,
861+
| "org.scalatest" %% "scalactic" % "3.2.14"
862+
|)
863+
|""".stripMargin
864+
)
865+
runApplyUpdate(update, original, expected)
866+
}
867+
843868
private def runApplyUpdate(
844869
update: Update.Single,
845870
files: Map[String, String],

0 commit comments

Comments
 (0)