Skip to content

Commit

Permalink
Add and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rochala committed Dec 23, 2024
1 parent 3c48b0b commit 9c1c527
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,31 @@ class DiagnosticProviderSuite extends BasePCSuite with RangeReplace {
val actual = diagnostics.map(d => TestDiagnostic(d.getRange().getStart().getOffset(text), d.getRange().getEnd().getOffset(text), d.getMessage(), d.getSeverity()))
assertEquals(expected, actual, s"Expected [${expected.mkString(", ")}] but got [${actual.mkString(", ")}]")

@Test def simple1 =
@Test def error =
check(
"""|class Bar(i: <<It>>)
"""|class Bar(i: It)
|""".stripMargin,
List(TestDiagnostic(13, 15, "Not found: type It - did you mean Int.type? or perhaps Int?", DiagnosticSeverity.Error))
)

@Test def warning =
check(
"""|object M:
| 1 + 1
|""".stripMargin,
List(TestDiagnostic(12, 17, "A pure expression does nothing in statement position", DiagnosticSeverity.Warning))
)

@Test def mixed =
check(
"""|class Bar(i: It)
|object M:
| 1 + 1
|""".stripMargin,
List(
TestDiagnostic(13 ,15, "Not found: type It - did you mean Int.type? or perhaps Int?", DiagnosticSeverity.Error),
TestDiagnostic(29, 34, "A pure expression does nothing in statement position", DiagnosticSeverity.Warning)
)
)

}
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ object Build {
"scala2-library-tasty"
)

val enableBspAllProjects = false
val enableBspAllProjects = true

// Settings used when compiling dotty with a non-bootstrapped dotty
lazy val commonBootstrappedSettings = commonDottySettings ++ Seq(
Expand Down

0 comments on commit 9c1c527

Please sign in to comment.