Skip to content

Commit

Permalink
Make ktlint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
lziq committed Oct 21, 2022
1 parent 56ab702 commit 99c419e
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions lang/test/org/partiql/lang/eval/CastTestBase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1420,10 +1420,10 @@ abstract class CastTestBase : EvaluatorTestBase() {
case("TIME (3) WITH TIME ZONE '23:12:12.1267+05:30'", "\"23:12:12.127+05:30\"", CastQuality.LOSSLESS)
).types(listOf("string", "varchar"))
).flatten() +
listOf(ExprValueType.MISSING, ExprValueType.NULL, ExprValueType.BOOL, ExprValueType.INT, ExprValueType.FLOAT, ExprValueType.DECIMAL, ExprValueType.TIMESTAMP, ExprValueType.CLOB, ExprValueType.BLOB, ExprValueType.LIST, ExprValueType.SEXP, ExprValueType.STRUCT, ExprValueType.BAG)
.map {
listOf(case("DATE '2007-10-10'", ErrorCode.EVALUATOR_INVALID_CAST)).types(it.typeAliases())
}.flatten()
listOf(ExprValueType.MISSING, ExprValueType.NULL, ExprValueType.BOOL, ExprValueType.INT, ExprValueType.FLOAT, ExprValueType.DECIMAL, ExprValueType.TIMESTAMP, ExprValueType.CLOB, ExprValueType.BLOB, ExprValueType.LIST, ExprValueType.SEXP, ExprValueType.STRUCT, ExprValueType.BAG)
.map {
listOf(case("DATE '2007-10-10'", ErrorCode.EVALUATOR_INVALID_CAST)).types(it.typeAliases())
}.flatten()

private val typingModes: Map<String, (CompileOptions.Builder) -> Unit> = mapOf(
"LEGACY_TYPING_MODE" to { cob -> cob.legacyTypingMode() },
Expand Down Expand Up @@ -1452,32 +1452,32 @@ abstract class CastTestBase : EvaluatorTestBase() {
}

private val castPermissiveConfiguredTestCases = (
legacyCastTestCases.toPermissive().map { case ->
ConfiguredCastCase(case, "LEGACY_CAST, PERMISSIVE_TYPING_MODE") {
legacyCastBehavior()
permissiveTypingMode()
}
} + honorParamCastTestCases.toPermissive().map { case ->
ConfiguredCastCase(case, "HONOR_PARAM_CAST, PERMISSIVE_TYPING_MODE") {
honorTypedOpParameters()
permissiveTypingMode()
}
legacyCastTestCases.toPermissive().map { case ->
ConfiguredCastCase(case, "LEGACY_CAST, PERMISSIVE_TYPING_MODE") {
legacyCastBehavior()
permissiveTypingMode()
}
)
} + honorParamCastTestCases.toPermissive().map { case ->
ConfiguredCastCase(case, "HONOR_PARAM_CAST, PERMISSIVE_TYPING_MODE") {
honorTypedOpParameters()
permissiveTypingMode()
}
}
)

private val castLegacyConfiguredTestCases = (
legacyCastTestCases.map { case ->
ConfiguredCastCase(case, "LEGACY_CAST, LEGACY_ERROR_MODE") {
legacyCastBehavior()
legacyTypingMode()
}
} + honorParamCastTestCases.map { case ->
ConfiguredCastCase(case, "HONOR_PARAM_CAST, LEGACY_ERROR_MODE") {
honorTypedOpParameters()
legacyTypingMode()
}
legacyCastTestCases.map { case ->
ConfiguredCastCase(case, "LEGACY_CAST, LEGACY_ERROR_MODE") {
legacyCastBehavior()
legacyTypingMode()
}
)
} + honorParamCastTestCases.map { case ->
ConfiguredCastCase(case, "HONOR_PARAM_CAST, LEGACY_ERROR_MODE") {
honorTypedOpParameters()
legacyTypingMode()
}
}
)

private val castDefaultTimezoneOffsetConfiguration =
// Configuring default timezone offset through CompileOptions
Expand Down Expand Up @@ -1553,47 +1553,47 @@ abstract class CastTestBase : EvaluatorTestBase() {
}

private val canCastConfiguredTestCases = (
legacyCastTestCases.flatMap { case ->
typingModes.map { (typingModeName, typingModeConfig) ->
ConfiguredCastCase(case.toCanCast(), "LEGACY_CAST, $typingModeName") {
legacyCastBehavior()
typingModeConfig(this)
}
legacyCastTestCases.flatMap { case ->
typingModes.map { (typingModeName, typingModeConfig) ->
ConfiguredCastCase(case.toCanCast(), "LEGACY_CAST, $typingModeName") {
legacyCastBehavior()
typingModeConfig(this)
}
} + honorParamCastTestCases.flatMap { case ->
typingModes.map { (typingModeName, typingModeConfig) ->
ConfiguredCastCase(case.toCanCast(), "HONOR_PARAM_CAST, $typingModeName") {
honorTypedOpParameters()
typingModeConfig(this)
}
}
} + honorParamCastTestCases.flatMap { case ->
typingModes.map { (typingModeName, typingModeConfig) ->
ConfiguredCastCase(case.toCanCast(), "HONOR_PARAM_CAST, $typingModeName") {
honorTypedOpParameters()
typingModeConfig(this)
}
}
)
}
)

private val canLosslessCastConfiguredTestCases = (
legacyCastTestCases.flatMap { case ->
typingModes.map { (typingModeName, typingModeConfig) ->
ConfiguredCastCase(case.toCanLosslessCast(), "LEGACY_CAST, $typingModeName") {
legacyCastBehavior()
typingModeConfig(this)
}
legacyCastTestCases.flatMap { case ->
typingModes.map { (typingModeName, typingModeConfig) ->
ConfiguredCastCase(case.toCanLosslessCast(), "LEGACY_CAST, $typingModeName") {
legacyCastBehavior()
typingModeConfig(this)
}
} + honorParamCastTestCases.flatMap { case ->
typingModes.map { (typingModeName, typingModeConfig) ->
ConfiguredCastCase(case.toCanLosslessCast(), "HONOR_PARAM_CAST, $typingModeName") {
honorTypedOpParameters()
typingModeConfig(this)
}
}
} + honorParamCastTestCases.flatMap { case ->
typingModes.map { (typingModeName, typingModeConfig) ->
ConfiguredCastCase(case.toCanLosslessCast(), "HONOR_PARAM_CAST, $typingModeName") {
honorTypedOpParameters()
typingModeConfig(this)
}
}
)
}
)

internal val allConfiguredTestCases =
castConfiguredTestCases +
castToAnyConfiguredTestCases +
canCastAndIsToAnyConfiguredTestCases +
canCastConfiguredTestCases +
canLosslessCastConfiguredTestCases
castToAnyConfiguredTestCases +
canCastAndIsToAnyConfiguredTestCases +
canCastConfiguredTestCases +
canLosslessCastConfiguredTestCases

private val configuredDateTimeTestCases = commonDateTimeTests.map { case ->
ConfiguredCastCase(case, "LEGACY_ERROR_MODE") {
Expand Down Expand Up @@ -1639,7 +1639,7 @@ abstract class CastTestBase : EvaluatorTestBase() {

internal val allConfiguredDateTimeTestCases =
configuredDateTimeTestCases +
canCastConfiguredDateTimeTestCases +
canLosslessCastConfiguredDateTimeTestCases
canCastConfiguredDateTimeTestCases +
canLosslessCastConfiguredDateTimeTestCases
}
}

0 comments on commit 99c419e

Please sign in to comment.