Skip to content

Commit 7311c7b

Browse files
committed
Move EXPLAIN test into QueryTest; rename pkg tests.
1 parent cbc7010 commit 7311c7b

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

modules/tests/shared/src/test/scala/CommandTest.scala

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,6 @@ class CommandTest extends SkunkTest {
9494
WHERE id = $int4
9595
""".command
9696

97-
val explainCity: Query[Void, String] =
98-
sql"""
99-
EXPLAIN SELECT * FROM city
100-
""".query(skunk.codec.all.text)
101-
10297
val createTable: Command[Void] =
10398
sql"""
10499
CREATE TABLE IF NOT EXISTS earth (
@@ -461,14 +456,6 @@ class CommandTest extends SkunkTest {
461456
} yield "ok"
462457
}
463458

464-
sessionTest("explain command") { s =>
465-
for {
466-
c <- s.unique(explainCity)
467-
_ <- assert("completion", c.startsWith("Seq Scan on city"))
468-
_ <- s.assertHealthy
469-
} yield "ok"
470-
}
471-
472459
sessionTest("set constraints") { s =>
473460
s.transaction.use { _ =>
474461
for {

modules/tests/shared/src/test/scala/QueryTest.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This software is licensed under the MIT License (MIT).
33
// For more information see LICENSE or https://opensource.org/licenses/MIT
44

5-
package test
5+
package tests
66

77
import skunk._
88
import skunk.codec.all._
@@ -132,4 +132,13 @@ class QueryTest extends SkunkTest {
132132
}
133133
} yield "ok"
134134
}
135+
136+
sessionTest("explain query") { s =>
137+
for {
138+
c <- s.unique(sql"""EXPLAIN SELECT * FROM city""".query(skunk.codec.all.text))
139+
_ <- assert("completion", c.startsWith("Seq Scan on city"))
140+
_ <- s.assertHealthy
141+
} yield "ok"
142+
}
143+
135144
}

0 commit comments

Comments
 (0)