@@ -883,4 +883,59 @@ class SipScalaTests extends ScalaCliSuite
883
883
expect(launcherVersionOverrideHelp == standardVersionOverrideHelp)
884
884
}
885
885
}
886
+
887
+ test(" coursier scala installation works with utf8 paths" ) {
888
+ val utf8DirPath = os.rel / " äöü"
889
+ TestInputs (utf8DirPath / " version.sc" ->
890
+ " println(dotty.tools.dotc.config.Properties.versionNumberString)" )
891
+ .fromRoot { root =>
892
+ val rootWithUtf8 = root / utf8DirPath
893
+ val localCache = rootWithUtf8 / " local-cache"
894
+ val localBin = rootWithUtf8 / " local-bin"
895
+ val scalaVersion = Constants .scala3NextRcAnnounced
896
+ withScalaRunnerWrapper(
897
+ root = rootWithUtf8,
898
+ localCache = localCache,
899
+ localBin = localBin,
900
+ scalaVersion = scalaVersion
901
+ ) { launchScalaPath =>
902
+ val r = os.proc(launchScalaPath, " --with-compiler" , " version.sc" )
903
+ .call(
904
+ cwd = rootWithUtf8,
905
+ env = Map (" COURSIER_CACHE" -> localCache.toString),
906
+ check = false // need to clean up even on failure
907
+ )
908
+ expect(r.exitCode == 0 )
909
+ expect(r.out.trim() == scalaVersion)
910
+ }
911
+ }
912
+ }
913
+
914
+ test(" coursier scala installation works with utf8 paths" ) {
915
+ val utf8DirPath = os.rel / " äöü"
916
+ TestInputs (utf8DirPath / " version.sc" ->
917
+ " println(dotty.tools.dotc.config.Properties.versionNumberString)" )
918
+ .fromRoot { root =>
919
+ val rootWithUtf8 = root / utf8DirPath
920
+ val localCache = rootWithUtf8 / " local-cache"
921
+ val localBin = rootWithUtf8 / " local-bin"
922
+ val scalaVersion = Constants .scala3NextRcAnnounced
923
+ // ensure cs works at all
924
+ os.proc(TestUtil .cs, " version" )
925
+ .call(cwd = rootWithUtf8, stdout = os.Inherit )
926
+ // ensure scala is installable
927
+ os.proc(
928
+ TestUtil .cs,
929
+ " install" ,
930
+ " --cache" ,
931
+ localCache,
932
+ " --install-dir" ,
933
+ localBin,
934
+ s " scala: $scalaVersion"
935
+ ).call(cwd = rootWithUtf8)
936
+ // ensure scala got installed
937
+ os.proc(localBin / " scala.bat" , " --version" )
938
+ .call(cwd = rootWithUtf8, stdout = os.Inherit )
939
+ }
940
+ }
886
941
}
0 commit comments