File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
modules/core/src/test/scala/org/scalasteward/core/edit Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -840,7 +840,7 @@ 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) {
843+ test(" issue-2877: sbt using same version in a val and a literal using a Seq addition " .fail) {
844844 val update = (" org.scalatest" .g % Nel .of(
845845 " scalatest" .a,
846846 " scalactic" .a
@@ -868,6 +868,30 @@ class RewriteTest extends FunSuite {
868868 runApplyUpdate(update, original, expected)
869869 }
870870
871+ test(" issue-2877: sbt using same version in a val and a literal using individual additions" ) {
872+ val update = (" org.scalatest" .g % Nel .of(
873+ " scalatest" .a,
874+ " scalactic" .a
875+ ) % " 3.2.13" %> " 3.2.14" ).group
876+ val original = Map (
877+ " build.sbt" ->
878+ """
879+ |val ScalaTestVersion = "3.2.13"
880+ |libraryDependencies += "org.scalatest" %% "scalatest" % ScalaTestVersion
881+ |libraryDependencies += "org.scalatest" %% "scalactic" % "3.2.13"
882+ |""" .stripMargin
883+ )
884+ val expected = Map (
885+ " build.sbt" ->
886+ """
887+ |val ScalaTestVersion = "3.2.14"
888+ |libraryDependencies += "org.scalatest" %% "scalatest" % ScalaTestVersion
889+ |libraryDependencies += "org.scalatest" %% "scalactic" % "3.2.14"
890+ |""" .stripMargin
891+ )
892+ runApplyUpdate(update, original, expected)
893+ }
894+
871895 private def runApplyUpdate (
872896 update : Update .Single ,
873897 files : Map [String , String ],
You can’t perform that action at this time.
0 commit comments