Stabilize DB provider registration test
This commit is contained in:
1 parent
6d340824e4
commit
04e80c384e
1 file changed
+4
-3
@@ -74,13 +74,14 @@ class LyngDbModuleTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testDuplicateSchemeRegistrationFailsCaseInsensitively() = runTest {
|
fun testDuplicateSchemeRegistrationFailsCaseInsensitively() = runTest {
|
||||||
val importManager = Script.defaultImportManager.copy()
|
val importManager = ImportManager()
|
||||||
createDbModule(importManager)
|
createDbModule(importManager)
|
||||||
val module = importManager.createModuleScope(Pos.builtIn, "lyng.io.db")
|
val module = importManager.createModuleScope(Pos.builtIn, "lyng.io.db")
|
||||||
|
val scheme = "provider_test"
|
||||||
|
|
||||||
module.callFn("registerDatabaseProvider", ObjString("sqlite"), trivialOpener())
|
module.callFn("registerDatabaseProvider", ObjString(scheme), trivialOpener())
|
||||||
val error = try {
|
val error = try {
|
||||||
module.callFn("registerDatabaseProvider", ObjString("SQLITE"), trivialOpener())
|
module.callFn("registerDatabaseProvider", ObjString(scheme.uppercase()), trivialOpener())
|
||||||
kotlin.test.fail("expected duplicate registration to fail")
|
kotlin.test.fail("expected duplicate registration to fail")
|
||||||
} catch (e: ExecutionError) {
|
} catch (e: ExecutionError) {
|
||||||
e
|
e
|
||||||
|
|||||||
Reference in new issue
Block a user