improve-tests #28

Merged
flecomte merged 28 commits from improve-tests into master 2021-07-20 02:24:22 +02:00
4 changed files with 12 additions and 23 deletions
Showing only changes of commit b70230fd4c - Show all commits

View File

@@ -71,17 +71,7 @@ data class Function(
it.sendQuery("ROLLBACK")
}.join()
return Status.OK // TODO
}
override fun status(): Status {
connection.inTransaction {
up()
down()
it.sendQuery("ROLLBACK")
}.join()
return Status.OK // TODO
return Status.OK
}
fun copy(): Function {

View File

@@ -44,17 +44,7 @@ data class MigrationScript(
it.sendQuery("ROLLBACK")
}.join()
return Migration.Status.OK // TODO
}
override fun status(): Migration.Status {
connection.inTransaction {
up()
down()
it.sendQuery("ROLLBACK")
}.join()
return Migration.Status.OK // TODO
return Migration.Status.OK
}
fun copy(): MigrationScript {

View File

@@ -28,7 +28,6 @@ interface Migration {
fun up(): Status
fun down(): Status
fun test(): Status
fun status(): Status
enum class Status(i: Int) { OK(2), UP_FAIL(0), DOWN_FAIL(1) }
enum class Action { OK, UP, DOWN }

View File

@@ -45,6 +45,16 @@ class RequesterTest : TestAbstract() {
assertEquals("DeleteTest", name)
}
@Test
fun `function toString`() {
val resources = this::class.java.getResource("/sql/function/Test").toURI()
val name: String = Requester(connection, functionsDirectory = resources)
.getFunction("test_function")
.toString()
assertEquals("test_function", name)
}
@Test
fun `add function as string`() {
val sql = """