fiw UPPERCASE on parameter type

This commit is contained in:
2023-06-02 20:28:02 +02:00
parent 0702e7dca8
commit 88d79b9609
2 changed files with 27 additions and 1 deletions

View File

@@ -156,7 +156,7 @@ internal data class Context(
val script: String, val script: String,
) { ) {
fun afterBeginBy(vararg texts: String): Boolean = texts.any { fun afterBeginBy(vararg texts: String): Boolean = texts.any {
script.drop(index + 1).take(it.length) == it script.drop(index + 1).take(it.length).lowercase() == it.lowercase()
} }
fun afterBeginBy(vararg texts: Regex): Boolean = texts.any { fun afterBeginBy(vararg texts: Regex): Boolean = texts.any {
it.matchAt(script, index + 1) != null it.matchAt(script, index + 1) != null

View File

@@ -218,6 +218,32 @@ class FunctionTest : FreeSpec({
} }
} }
"Parameters with default int" - {
val param = parseFunction(
// language=PostgreSQL
"""
create or replace function myfun(one int DEFAULT 123456 ) returns text language plpgsql as
$$ begin end;$$;
""".trimIndent()
).parameters
"should have 1 parameters" {
param shouldHaveSize 1
}
"should have name" {
param[0].name shouldBe "one"
}
"should have type name" {
param[0].type.name shouldBe "int"
}
"should have default text" {
param[0].default shouldBe "123456"
}
}
"parameters with IN OUT INOUT" - { "parameters with IN OUT INOUT" - {
val param = parseFunction( val param = parseFunction(
// language=PostgreSQL // language=PostgreSQL