Skip to content

Commit

Permalink
regexp code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Jun 1, 2023
1 parent b9be1b5 commit c831b70
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions dataset/src/test/scala/frameless/ColumnTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.scalatest.matchers.should.Matchers
import shapeless.test.illTyped

import scala.math.Ordering.Implicits._
import scala.util.Try

final class ColumnTests extends TypedDatasetSuite with Matchers {

Expand Down Expand Up @@ -204,15 +205,7 @@ final class ColumnTests extends TypedDatasetSuite with Matchers {
val spark = session
import spark.implicits._

val regex =
Gen.nonEmptyListOf(arbitrary[Char]).map(_.mkString).suchThat{ str =>
try {
str.r
true
} catch {
case _: Throwable => false
}
}
val regex = Gen.nonEmptyListOf(arbitrary[Char]).map(_.mkString).suchThat { str => Try(str.r).isSuccess }

check {
forAll(regex, arbitrary[String]) { (a, b) =>
Expand Down

0 comments on commit c831b70

Please sign in to comment.