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 6d1c69c
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions dataset/src/test/scala/frameless/ColumnTests.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package frameless

import java.time.{Instant, Period, Duration}
import java.time.{Duration, Instant, Period}
import org.scalacheck.Prop._
import org.scalacheck.{Arbitrary, Gen, Prop}, Arbitrary.arbitrary
import org.scalacheck.{Arbitrary, Gen, Prop}
import Arbitrary.arbitrary
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 +206,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 6d1c69c

Please sign in to comment.