File tree Expand file tree Collapse file tree 3 files changed +25
-19
lines changed
resources/resources-test-project Expand file tree Collapse file tree 3 files changed +25
-19
lines changed Original file line number Diff line number Diff line change 11import Dependencies ._
2-
3- bloopExportJarClassifiers in Global := Some (Set (" sources" ))
42bloopConfigDir in Global := baseDirectory.value / " bloop-config"
53
6- ThisBuild / scalaVersion := " 2.12.9 "
4+ ThisBuild / scalaVersion := " 2.12.20 "
75ThisBuild / version := " 0.1.0-SNAPSHOT"
86ThisBuild / organization := " com.example"
97ThisBuild / organizationName := " example"
108
119lazy val root = (project in file(" ." ))
1210 .settings(
13- name := " Resources Test Project " ,
11+ name := " resources-test-project " ,
1412 libraryDependencies += munit % Test ,
1513 fork in Test := true
1614 )
Original file line number Diff line number Diff line change @@ -807,6 +807,29 @@ class BspMetalsClientSpec(
807807 }
808808 }
809809
810+ test(" resource not found in tests" ) {
811+ TestUtil .withinWorkspace { workspace =>
812+ val logger = new RecordingLogger (ansiCodesSupported = false )
813+ val projectDir = " resources-test-project"
814+ val projectName = " root-test"
815+ loadBspBuildFromResources(
816+ projectDir,
817+ workspace,
818+ logger,
819+ " Metals"
820+ ) { build =>
821+ val project = build.projectFor(projectName)
822+ val projectPath = project.baseDir
823+ val state = build.state
824+ assertNoDiff(logger.warnings.mkString(lineSeparator), " " )
825+ val compiledState = state.compile(project)
826+ val testState = compiledState.test(project)
827+ assert(compiledState.status == ExitStatus .Ok )
828+ assert(testState.status == ExitStatus .Ok )
829+ }
830+ }
831+ }
832+
810833 private val dummyFooScalaSources = List (
811834 """ /Foo.scala
812835 |class Foo
Original file line number Diff line number Diff line change @@ -661,19 +661,4 @@ object TestUtil {
661661 DependencyResolution .Artifact (" org.testng" , " testng" , " 7.9.0" )
662662 DependencyResolution .resolve(List (testNG), logger)
663663 }
664-
665- def getMunitDep (logger : Logger ) = {
666- // TODO: figure out clean way
667- val version =
668- if (Properties .versionNumberString.startsWith(" 2.12" )) {
669- " 2.12"
670- } else if (Properties .versionNumberString.startsWith(" 2.13" )) {
671- " 2.13"
672- } else {
673- " 3"
674- }
675- val testNG =
676- DependencyResolution .Artifact (" org.scalameta" , s " munit_ $version" , " 1.1.1" )
677- DependencyResolution .resolve(List (testNG), logger)
678- }
679664}
You can’t perform that action at this time.
0 commit comments