-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
584 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
partiql-planner/src/test/kotlin/org/partiql/planner/internal/ddl/DDLPlanTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.partiql.planner.internal.ddl | ||
|
||
import org.junit.jupiter.api.assertThrows | ||
import org.junit.jupiter.params.ParameterizedTest | ||
import org.junit.jupiter.params.provider.MethodSource | ||
import org.partiql.planner.internal.ir.PartiQLPlan | ||
import org.partiql.planner.internal.ir.statementDDL | ||
import org.partiql.planner.internal.transforms.PlanTransform | ||
import org.partiql.types.StaticType | ||
import kotlin.test.assertEquals | ||
|
||
internal class DDLPlanTests { | ||
val transform = PlanTransform(setOf()) | ||
val typer = DDLTestBase.typer | ||
fun run(tc: DDLTestBase.TestCase) { | ||
if (tc.publicPlan != null) { | ||
val typed = typer.resolve(statementDDL(StaticType.ANY, tc.untyped)) | ||
val internal = PartiQLPlan(typed) | ||
assertEquals(tc.publicPlan, transform.transform(internal, {}).statement) | ||
} else { | ||
assertThrows<NotImplementedError> { | ||
val typed = typer.resolve(statementDDL(StaticType.ANY, tc.untyped)) | ||
val internal = PartiQLPlan(typed) | ||
transform.transform(internal, {}) | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
@JvmStatic | ||
fun testCases() = DDLTestBase.testCases() | ||
} | ||
|
||
@ParameterizedTest | ||
@MethodSource("testCases") | ||
fun test(tc: DDLTestBase.TestCase) = run(tc) | ||
} |
Oops, something went wrong.