From fe877d5c90af1255de5435593df3047bd7556253 Mon Sep 17 00:00:00 2001 From: evanchooly Date: Sun, 23 Jun 2024 13:02:36 -0400 Subject: [PATCH] ensmarten data/index discovery --- .../src/main/kotlin/dev/morphia/audits/rst/OperatorExample.kt | 4 ++-- audits/src/test/kotlin/dev/morphia/audits/QueryAuditTest.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/audits/src/main/kotlin/dev/morphia/audits/rst/OperatorExample.kt b/audits/src/main/kotlin/dev/morphia/audits/rst/OperatorExample.kt index 92bd229271c..57e5c00baf8 100644 --- a/audits/src/main/kotlin/dev/morphia/audits/rst/OperatorExample.kt +++ b/audits/src/main/kotlin/dev/morphia/audits/rst/OperatorExample.kt @@ -22,7 +22,8 @@ class OperatorExample( init { val blocks = findBlocks(input) - dataBlock += blocks.removeWhile { !it.isAction() } + indexBlock = blocks.removeWhile { it.isIndex() }.firstOrNull() + dataBlock += blocks.removeWhile { !it.isAction() && !it.isIndex() } dataBlock.forEachIndexed { index, block -> block.type = DATA if (index != 0) { @@ -30,7 +31,6 @@ class OperatorExample( } } actionBlock = blocks.firstOrNull { it.isAction() } - indexBlock = blocks.firstOrNull { it.isIndex() } expectedBlock = blocks.firstOrNull { it.isExpected() } if (dataBlock.isEmpty()) { diff --git a/audits/src/test/kotlin/dev/morphia/audits/QueryAuditTest.kt b/audits/src/test/kotlin/dev/morphia/audits/QueryAuditTest.kt index 1a64597ec78..79cf7799bca 100644 --- a/audits/src/test/kotlin/dev/morphia/audits/QueryAuditTest.kt +++ b/audits/src/test/kotlin/dev/morphia/audits/QueryAuditTest.kt @@ -13,8 +13,8 @@ class QueryAuditTest : BaseAuditTest() { @Test fun testOperator() { - val name = "ne" + val name = "text" val operator = Operator(FILTER, name) - operator.examples.forEach { it.output(File("target/testOperator-${name}/${it.name}")) } + operator.examples.forEach { it.output(File("target/testOperator/${name}/${it.name}")) } } }