Skip to content

Commit 52df5f3

Browse files
airborne12claude
andcommitted
[test](inverted index) Update the union iterator test that expected norm() to throw
### What problem does this PR solve? Issue Number: None Related PR: #69699 Problem Summary: PhraseFreqTest.UnionTermIterator_NormThrowsException asserted that UnionTermIterator::norm() throws, which the previous commit removed: a union now returns the norm of the sub-iterator on the current row. The test asserts the norm instead. The earlier unit test run of the change used a filter that did not include this test. ### Release note None ### Check List (For Author) - Test: Unit Test - 1364 inverted index related BE unit tests pass, including this one. - Behavior changed: No - Does this need documentation: No Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 68a2d36 commit 52df5f3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎be/test/storage/index/inverted/query/phrase_query/phrase_freq_test.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ TEST_F(PhraseFreqTest, NormVisitor_WithDISI) {
237237
EXPECT_EQ(norm, 1);
238238
}
239239

240-
TEST_F(PhraseFreqTest, UnionTermIterator_NormThrowsException) {
240+
// A phrase prefix scores a row with the norm of its union, which the sub-iterator on the row gives.
241+
TEST_F(PhraseFreqTest, UnionTermIterator_NormIsThatOfTheSubOnTheDocument) {
241242
auto mock1 = std::make_shared<MockIterator>();
242243
mock1->set_postings({{1, {0}}});
243244
auto mock2 = std::make_shared<MockIterator>();
@@ -246,7 +247,7 @@ TEST_F(PhraseFreqTest, UnionTermIterator_NormThrowsException) {
246247
std::vector<std::shared_ptr<MockIterator>> subs = {mock1, mock2};
247248
UnionTermIterator<MockIterator> union_iter(subs);
248249

249-
EXPECT_THROW(union_iter.norm(), Exception);
250+
EXPECT_EQ(union_iter.norm(), 1);
250251
}
251252

252253
TEST_F(PhraseFreqTest, ExactPhraseMatcher_MultipleDocuments) {

0 commit comments

Comments
 (0)