Skip to content

Commit

Permalink
Fix tests failing in the CI, make trait-bridge-signatures test stable…
Browse files Browse the repository at this point in the history
… with different JVM versions
  • Loading branch information
WojciechMazur committed May 31, 2024
1 parent e52535f commit 9d7a585
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class SpecializeFunctionsTests extends DottyBytecodeTest {
}
.map(_.name)
.toList
.distinct // ignore bridge methods

assert(
apps.length == 1,
Expand Down
13 changes: 11 additions & 2 deletions tests/run/trait-bridge-signatures.scala
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,19 @@ object Test {
classOf[collections.Iterable[?]],
classOf[collections.IterableOps[?, ?, ?]],
Class.forName("collections$Seq")
).foreach(show(_, m => List("head", "tail", "from").contains(m.getName())))
).foreach: cls =>
show(cls, filter = m => List("head", "tail", "from").contains(m.getName()) && {
// Divirgence between JVM version
// In JDK 8 (CI Windows runner) `java.lang.Object collections$IterableOps.head()` is shown
// but it's not shown in JDK 17 (CI Unix runner)
// Filter out problematic case to make tests more stable
if cls == classOf[collections.LinearSeq[?]] then
List(cls, classOf[collections.LinearSeqOps[?, ?, ?]]).contains(m.getDeclaringClass())
else true
}
)

show(Class.forName("EmptyCollection"), _.getName() == "andThen")

show(classOf[play.WSRequest])
}
}

0 comments on commit 9d7a585

Please sign in to comment.