Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split MiscTest into RelationalMiscTest and JdbcMiscTest.
- All misc. tests except the ones for "fake" nullability can run against RelationalProfile. - The IfThen clauses in ConditionalExpr nodes were in reverse order for no good reason. Changing to declaration order. - Support ConditionalExpr and Like in QueryInterpreter
- Loading branch information
Showing
7 changed files
with
119 additions
and
78 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcMiscTest.scala
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,45 @@ | ||
package com.typesafe.slick.testkit.tests | ||
|
||
import org.junit.Assert._ | ||
import com.typesafe.slick.testkit.util.{JdbcTestDB, TestkitTest} | ||
|
||
class JdbcMiscTest extends TestkitTest[JdbcTestDB] { | ||
import tdb.profile.simple._ | ||
|
||
override val reuseInstance = true | ||
|
||
def testNullability { | ||
object T1 extends Table[String]("t1") { | ||
def a = column[String]("a") | ||
def * = a | ||
} | ||
|
||
object T2 extends Table[String]("t2") { | ||
def a = column[String]("a", O.Nullable) | ||
def * = a | ||
} | ||
|
||
object T3 extends Table[Option[String]]("t3") { | ||
def a = column[Option[String]]("a") | ||
def * = a | ||
} | ||
|
||
object T4 extends Table[Option[String]]("t4") { | ||
def a = column[Option[String]]("a", O.NotNull) | ||
def * = a | ||
} | ||
|
||
(T1.ddl ++ T2.ddl ++ T3.ddl ++ T4.ddl).create | ||
|
||
T1.insert("a") | ||
T2.insert("a") | ||
T3.insert(Some("a")) | ||
T4.insert(Some("a")) | ||
|
||
T2.insert(null.asInstanceOf[String]) | ||
T3.insert(None) | ||
|
||
assertFail { T1.insert(null.asInstanceOf[String]) } | ||
assertFail { T4.insert(None) } | ||
} | ||
} |
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
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