Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek authored and tgodzik committed Sep 10, 2024
1 parent ef82c67 commit 8cbfa44
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
40 changes: 27 additions & 13 deletions frontend/src/test/scala/bloop/bsp/BspCompileSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,13 @@ class BspCompileSpec(
"""#3: a/src/A.scala
| -> List()
| -> reset = true
|#3: task start 3
| -> Msg: Start no-op compilation for a
| -> Data kind: compile-task
|#3: task finish 3
| -> errors 0, warnings 0
| -> Msg: Compiled 'a'
| -> Data kind: compile-report
""".stripMargin // no-op so it only gives the compile-report
)

Expand All @@ -590,7 +597,7 @@ class BspCompileSpec(
assertSameExternalClassesDirs(fourthCompiledState, compiledState, projects)
assertNoDiff(
fourthCompiledState.lastDiagnostics(`A`),
"""#4: task start 3
"""#4: task start 4
| -> Msg: Compiling a (1 Scala source)
| -> Data kind: compile-task
|#4: a/src/A.scala
Expand All @@ -599,7 +606,7 @@ class BspCompileSpec(
|#4: a/src/A.scala
| -> List(Diagnostic(Range(Position(0,0),Position(0,26)),Some(Warning),Some(_),Some(_),Unused import,None,None,Some({"actions":[]})))
| -> reset = false
|#4: task finish 3
|#4: task finish 4
| -> errors 1, warnings 1
| -> Msg: Compiled 'a'
| -> Data kind: compile-report
Expand All @@ -613,13 +620,13 @@ class BspCompileSpec(
assertDifferentExternalClassesDirs(fifthCompiledState, compiledState, projects)
assertNoDiff(
fifthCompiledState.lastDiagnostics(`A`),
"""#5: task start 4
"""#5: task start 5
| -> Msg: Compiling a (1 Scala source)
| -> Data kind: compile-task
|#5: a/src/A.scala
| -> List(Diagnostic(Range(Position(0,0),Position(0,26)),Some(Warning),Some(_),Some(_),Unused import,None,None,Some({"actions":[]})))
| -> reset = true
|#5: task finish 4
|#5: task finish 5
| -> errors 0, warnings 1
| -> Msg: Compiled 'a'
| -> Data kind: compile-report
Expand All @@ -639,17 +646,17 @@ class BspCompileSpec(
assertSameExternalClassesDirs(sixthCompiledState, fifthCompiledState, projects)
assertNoDiff(
sixthCompiledState.lastDiagnostics(`A`),
"""#6: task start 5
"""#6: task start 6
| -> Msg: Compiling a (1 Scala source)
| -> Data kind: compile-task
|#6: a/src/A.scala
| -> List()
| -> reset = true
|#6: task finish 5
|#6: task finish 6
| -> errors 0, warnings 0
| -> Msg: Compiled 'a'
| -> Data kind: compile-report
|#6: task start 5
|#6: task start 6
| -> Msg: Compiling a (1 Scala source)
| -> Data kind: compile-task
|#6: a/src/A.scala
Expand All @@ -658,7 +665,7 @@ class BspCompileSpec(
|#6: a/src/A.scala
| -> List(Diagnostic(Range(Position(1,0),Position(3,1)),Some(Error),Some(_),Some(_),object creation impossible, since value y in trait Base of type Int is not defined,None,None,Some({"actions":[]})))
| -> reset = false
|#6: task finish 5
|#6: task finish 6
| -> errors 1, warnings 1
| -> Msg: Compiled 'a'
| -> Data kind: compile-report
Expand All @@ -673,13 +680,13 @@ class BspCompileSpec(

assertNoDiff(
seventhCompiledState.lastDiagnostics(`A`),
"""#7: task start 6
"""#7: task start 7
| -> Msg: Compiling a (1 Scala source)
| -> Data kind: compile-task
|#7: a/src/A.scala
| -> List(Diagnostic(Range(Position(0,0),Position(0,26)),Some(Warning),Some(_),Some(_),Unused import,None,None,Some({"actions":[]})))
| -> reset = true
|#7: task finish 6
|#7: task finish 7
| -> errors 0, warnings 0
| -> Msg: Compiled 'a'
| -> Data kind: compile-report
Expand Down Expand Up @@ -953,9 +960,16 @@ class BspCompileSpec(

assertNoDiff(
thirdCompiledState.lastDiagnostics(`A`),
"""#3: a/src/main/scala/Bar.scala
| -> List()
| -> reset = true""".stripMargin
"""|#3: a/src/main/scala/Bar.scala
| -> List()
| -> reset = true
|#3: task start 3
| -> Msg: Start no-op compilation for a
| -> Data kind: compile-task
|#3: task finish 3
| -> errors 0, warnings 0
| -> Msg: Compiled 'a'
| -> Data kind: compile-report""".stripMargin
)
}
}
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/test/scala/bloop/bsp/BspSbtClientSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,14 @@ class BspSbtClientSpec(
thirdCompiledState.lastDiagnostics(`A`),
"""#3: a/src/main/scala/Foo.scala
| -> List()
| -> reset = true""".stripMargin
| -> reset = true
|#3: task start 3
| -> Msg: Start no-op compilation for a
| -> Data kind: compile-task
|#3: task finish 3
| -> errors 0, warnings 0
| -> Msg: Compiled 'a'
| -> Data kind: compile-report""".stripMargin
)
}
}
Expand Down

0 comments on commit 8cbfa44

Please sign in to comment.