-
Notifications
You must be signed in to change notification settings - Fork 496
/
HSqlFixturesTest.kt
35 lines (30 loc) · 988 Bytes
/
HSqlFixturesTest.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package app.cash.sqldelight.dialects.hsql
import com.alecstrong.sql.psi.test.fixtures.FixturesTest
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.junit.runners.Parameterized.Parameters
import java.io.File
@RunWith(Parameterized::class)
class HSqlFixturesTest(name: String, fixtureRoot: File) : FixturesTest(name, fixtureRoot) {
override val replaceRules = arrayOf(
"TEXT" to "VARCHAR(8)",
"AUTOINCREMENT" to "AUTO_INCREMENT",
"?1" to ":one",
"?2" to ":two",
)
override fun setupDialect() {
HsqlDialect().setup()
}
companion object {
private val fixtures = arrayOf("src/test/fixtures_hsql")
@Suppress("unused")
// Used by Parameterized JUnit runner reflectively.
@Parameters(name = "{0}")
@JvmStatic
fun parameters() = fixtures.flatMap { fixtureFolder ->
File(fixtureFolder).listFiles()!!
.filter { it.isDirectory }
.map { arrayOf(it.name, it) }
} + ansiFixtures
}
}