WIP on count impl; reworking comparisons

This commit is contained in:
2025-02-27 23:38:38 -05:00
parent 250e216ae8
commit a84c8289b1
20 changed files with 548 additions and 77 deletions

View File

@@ -0,0 +1,47 @@
package solutions.bitbadger.documents.postgresql
import org.junit.jupiter.api.DisplayName
import solutions.bitbadger.documents.common.Count
import kotlin.test.Test
/**
* PostgreSQL integration tests for the `Count` object / `count*` connection extension functions
*/
@DisplayName("PostgreSQL - Count")
class CountIT {
@Test
@DisplayName("all counts all documents")
fun all() =
PgDB().use(Count::all)
@Test
@DisplayName("byFields counts documents by a numeric value")
fun byFieldsNumeric() =
PgDB().use(Count::byFieldsNumeric)
@Test
@DisplayName("byFields counts documents by a alphanumeric value")
fun byFieldsAlpha() =
PgDB().use(Count::byFieldsAlpha)
@Test
@DisplayName("byContains counts documents when matches are found")
fun byContainsMatch() =
PgDB().use(Count::byContainsMatch)
@Test
@DisplayName("byContains counts documents when no matches are found")
fun byContainsNoMatch() =
PgDB().use(Count::byContainsNoMatch)
@Test
@DisplayName("byJsonPath counts documents when matches are found")
fun byJsonPathMatch() =
PgDB().use(Count::byJsonPathMatch)
@Test
@DisplayName("byJsonPath counts documents when no matches are found")
fun byJsonPathNoMatch() =
PgDB().use(Count::byJsonPathNoMatch)
}

View File

@@ -19,4 +19,14 @@ class DefinitionIT {
@DisplayName("ensureFieldIndex creates an index")
fun ensureFieldIndex() =
PgDB().use(Definition::ensureFieldIndex)
@Test
@DisplayName("ensureDocumentIndex creates a full index")
fun ensureDocumentIndexFull() =
PgDB().use(Definition::ensureDocumentIndexFull)
@Test
@DisplayName("ensureDocumentIndex creates an optimized index")
fun ensureDocumentIndexOptimized() =
PgDB().use(Definition::ensureDocumentIndexOptimized)
}