Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete dead code #696

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions munit/shared/src/main/scala/munit/MUnitRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -361,40 +361,6 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
}
}

private[munit] class ForeachUnsafeResult(
val sync: Try[Unit],
val async: List[Future[Any]]
)
private def foreachUnsafe(
thunks: Iterable[() => Any]
): ForeachUnsafeResult = {
var errors = mutable.ListBuffer.empty[Throwable]
val async = mutable.ListBuffer.empty[Future[Any]]
thunks.foreach { thunk =>
try {
thunk() match {
case f: Future[_] =>
async += f
case _ =>
}
} catch {
case ex if NonFatal(ex) =>
errors += ex
}
}
errors.toList match {
case head :: tail =>
tail.foreach { e =>
if (e ne head) {
head.addSuppressed(e)
}
}
new ForeachUnsafeResult(scala.util.Failure(head), Nil)
case _ =>
new ForeachUnsafeResult(scala.util.Success(()), Nil)
}
}

private def runHiddenTest(
notifier: RunNotifier,
name: String,
Expand Down