Skip to content

Commit

Permalink
assertContains
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Sep 21, 2023
1 parent 2969f97 commit 622b5c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import scala.collection.JavaConverters._

import com.google.common.annotations.VisibleForTesting
import com.google.common.collect.EvictingQueue
import org.apache.commons.lang3.StringUtils
import org.apache.commons.lang3.StringUtils.containsIgnoreCase

import org.apache.kyuubi._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,12 @@ object AssertionUtils {
/**
* Assert the iterable contains all the expected elements
*/
def assertContains(iter: TraversableOnce[AnyRef], elems: AnyRef*)(implicit
def assertContains(actual: TraversableOnce[AnyRef], expected: AnyRef*)(implicit
prettifier: Prettifier,
pos: Position): Unit = {
val iterableSeq = iter.toSeq
elems.foreach { elem =>
assert(iterableSeq.contains(elem), s", expected containing [${elems.mkString(", ")}]")(
prettifier,
pos)
val actualSeq = actual.toSeq
withClue(s", expected containing [${expected.mkString(", ")}]") {
expected.foreach { elem => assert(actualSeq.contains(elem))(prettifier, pos) }
}
}

Expand Down

0 comments on commit 622b5c9

Please sign in to comment.