Skip to content

Commit

Permalink
feat: [+] add test coverage of Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eruizalo committed Jun 6, 2022
1 parent c8cf00e commit e1be01f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions core/src/test/scala/doric/sem/ErrorsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sem

import doric.SparkSessionTestWrapper
import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.types.StringType
import org.scalatest.funspec.AnyFunSpecLike
import org.scalatest.matchers.should.Matchers

Expand Down Expand Up @@ -54,6 +55,26 @@ class ErrorsSpec

err.hashCode() shouldNot be(err2.hashCode())
}

it("should be equals if class and error message ar the same") {
val err = SparkErrorWrapper(
new Exception("this")
)
val err2 = SparkErrorWrapper(
new Exception("this")
)

err.equals(err2) shouldBe true
}

it("should NOT be equals if the second has no Throwable") {
val err = SparkErrorWrapper(
new Exception("this")
)
val err2 = ColumnTypeError("myColumn", StringType, StringType)

err.equals(err2) shouldBe false
}
}

}

0 comments on commit e1be01f

Please sign in to comment.