Skip to content

Commit

Permalink
Descriptive test class names
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed Nov 28, 2024
1 parent 71359ea commit 23c94a8
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@ object TypeProviderTest {
@BigQueryType.toTable
case class ToTable(f1: Long, f2: Double, f3: Boolean, f4: String, f5: Instant)

@BigQueryType.fromSchema("""
|{"fields": [{"mode": "REQUIRED", "name": "f1", "type": "INTEGER"}]}
|""".stripMargin)
class S1
@BigQueryType.fromSchema(
"""{"fields": [{"mode": "REQUIRED", "name": "f1", "type": "INTEGER"}]}"""
)
class SingleLineSchema

@BigQueryType.fromSchema("""
|{"fields": [{"mode": "REQUIRED", "name": "f1", "type": "INTEGER"}]}
|""".stripMargin)
class S2
@BigQueryType.fromSchema("""{
"fields": [{"mode": "REQUIRED", "name": "f1", "type": "INTEGER"}]
}""")
class MultiLineSchema

@BigQueryType.fromSchema("""
|{"fields": [{"mode": "REQUIRED", "name": "f1", "type": "INTEGER"}]}
|""".stripMargin)
class S3
class StripMarginSchema

@BigQueryType.fromSchema("""
|{"fields": [{"mode": "REQUIRED", "name": "f1", "type": "INTEGER"}]}
|""".stripMargin)
@BigQueryType.fromSchema(
"""{"fields": [{"mode": "REQUIRED", "name": "f1", "type": "INTEGER"}]}"""
)
@description("Table S4")
class S4
class DescriptionSchema

@BigQueryType.fromSchema(
"""
Expand Down Expand Up @@ -92,26 +92,26 @@ class TypeProviderTest extends AnyFlatSpec with Matchers {
import TypeProviderTest._

"BigQueryType.fromSchema" should "support string literal" in {
val r = S1(1L)
val r = SingleLineSchema(1L)
r.f1 shouldBe 1L
}

it should "support multi-line string literal" in {
val r = S2(1L)
val r = MultiLineSchema(1L)
r.f1 shouldBe 1L
}

it should "support multi-line string literal with stripMargin" in {
val r = S3(1L)
val r = StripMarginSchema(1L)
r.f1 shouldBe 1L
}

it should "support table description" in {
S4.tableDescription shouldBe "Table S4"
DescriptionSchema.tableDescription shouldBe "Table S4"
}

it should "be serializable" in {
SerializableUtils.ensureSerializable(S1(1))
SerializableUtils.ensureSerializable(SingleLineSchema(1L))
}

it should "infer the same schema" in {
Expand Down

0 comments on commit 23c94a8

Please sign in to comment.