Skip to content
Snippets Groups Projects
Commit 4402f840 authored by npedot's avatar npedot
Browse files

adds test mapping oneline with where condition

parent 35f8ef3a
No related branches found
No related tags found
No related merge requests found
...@@ -136,6 +136,23 @@ WHERE DepName is not null and DepAddress is not null LIMIT 10 ...@@ -136,6 +136,23 @@ WHERE DepName is not null and DepAddress is not null LIMIT 10
""".trimIndent(),actualSQL) """.trimIndent(),actualSQL)
} }
@Test
fun test_mapping_with_where_oneline() {
// given
val sqlQuery = "select SSN,DepName,DepAddress from table0 where DepName is not null and DepAddress is not null"
// when
val mapping = UnSQLizeSelectUseCase().fromsql("query1", sqlQuery)
val actualSQL = SQLizeCreateUseCase().createViewCommand(mapping)
// then
assertEquals("DepName is not null and DepAddress is not null", mapping.select.where.condition)
assertEquals("""
CREATE OR REPLACE VIEW public.query1 AS
SELECT SSN,DepName,DepAddress
FROM table0
WHERE DepName is not null and DepAddress is not null LIMIT 10
""".trimIndent(),actualSQL)
}
@Test @Test
fun test_multi_join() { fun test_multi_join() {
// given // given
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment