Skip to content

Commit

Permalink
test: fix hover doc suite for jdk22
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Nov 7, 2023
1 parent de02d82 commit 213e575
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 17 deletions.
54 changes: 37 additions & 17 deletions tests/javapc/src/test/scala/hover/HoverDocSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,43 @@ class HoverDocSuite extends BaseJavaHoverSuite {
| }
|}
|""".stripMargin,
"""|```java
|public void sort(java.util.Comparator<? super E> arg0)
|```
|Sorts this list according to the order induced by the specified
|[Comparator](Comparator). The sort is *stable*: this method must not
|reorder equal elements.
|
|All elements in this list must be *mutually comparable* using the
|specified comparator (that is, `c.compare(e1, e2)` must not throw
|a `ClassCastException` for any elements `e1` and `e2`
|in the list).
|
|If the specified comparator is `null` then all elements in this
|list must implement the [Comparable](Comparable) interface and the elements'
|[natural ordering](Comparable) should be used.
|
|This list must be modifiable, but need not be resizable.""".stripMargin,
if (isJava22)
"""|```java
|public void sort(java.util.Comparator<? super E> arg0)
|```
|Sorts this list according to the order induced by the specified
|[Comparator](Comparator) (optional operation). The sort is *stable*:
|this method must not reorder equal elements.
|
|All elements in this list must be *mutually comparable* using the
|specified comparator (that is, `c.compare(e1, e2)` must not throw
|a `ClassCastException` for any elements `e1` and `e2`
|in the list).
|
|If the specified comparator is `null` then all elements in this
|list must implement the [Comparable](Comparable) interface and the elements'
|[natural ordering](Comparable) should be used.
|
|This list must be modifiable, but need not be resizable.
|""".stripMargin
else
"""|```java
|public void sort(java.util.Comparator<? super E> arg0)
|```
|Sorts this list according to the order induced by the specified
|[Comparator](Comparator). The sort is *stable*: this method must not
|reorder equal elements.
|
|All elements in this list must be *mutually comparable* using the
|specified comparator (that is, `c.compare(e1, e2)` must not throw
|a `ClassCastException` for any elements `e1` and `e2`
|in the list).
|
|If the specified comparator is `null` then all elements in this
|list must implement the [Comparable](Comparable) interface and the elements'
|[natural ordering](Comparable) should be used.
|
|This list must be modifiable, but need not be resizable.""".stripMargin,
)

check(
Expand Down
3 changes: 3 additions & 0 deletions tests/mtest/src/main/scala/tests/BaseSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ abstract class BaseSuite extends munit.FunSuite with Assertions {
def isJava17: Boolean =
Properties.isJavaAtLeast("17")

def isJava22: Boolean =
Properties.isJavaAtLeast("22")

def isWindows: Boolean =
Properties.isWin

Expand Down

0 comments on commit 213e575

Please sign in to comment.