From 1c91d1a2b789fef8be6427de81c35658ff30009d Mon Sep 17 00:00:00 2001 From: Mark Benvenuto Date: Mon, 26 Oct 2015 11:20:12 -0400 Subject: Revert "SERVER-20888: Defer $language check to FTSQuery::Parse" This reverts commit 4c38ff13739e60d33d52b0c944d55249e7d9cc68. --- src/mongo/db/fts/fts_matcher_test.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/mongo/db/fts/fts_matcher_test.cpp') diff --git a/src/mongo/db/fts/fts_matcher_test.cpp b/src/mongo/db/fts/fts_matcher_test.cpp index 7694732e2e1..246510a9e70 100644 --- a/src/mongo/db/fts/fts_matcher_test.cpp +++ b/src/mongo/db/fts/fts_matcher_test.cpp @@ -38,7 +38,7 @@ namespace fts { TEST(FTSMatcher, NegWild1) { FTSQuery q; - q.parse("foo -bar", "english", false, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse("foo -bar", "english", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("$**" << "text"))))); @@ -52,7 +52,7 @@ TEST(FTSMatcher, NegWild1) { // Regression test for SERVER-11994. TEST(FTSMatcher, NegWild2) { FTSQuery q; - q.parse("pizza -restaurant", "english", false, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse("pizza -restaurant", "english", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("$**" << "text"))))); @@ -65,7 +65,7 @@ TEST(FTSMatcher, NegWild2) { TEST(FTSMatcher, Phrase1) { FTSQuery q; - q.parse("foo \"table top\"", "english", false, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse("foo \"table top\"", "english", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("$**" << "text"))))); @@ -87,7 +87,7 @@ TEST(FTSMatcher, Phrase1) { TEST(FTSMatcher, Phrase2) { FTSQuery q; - q.parse("foo \"table top\"", "english", false, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse("foo \"table top\"", "english", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" << "text"))))); @@ -98,7 +98,7 @@ TEST(FTSMatcher, Phrase2) { // language. TEST(FTSMatcher, ParsesUsingDocLanguage) { FTSQuery q; - q.parse("-glad", "none", false, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse("-glad", "none", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" << "text"))))); @@ -112,7 +112,7 @@ TEST(FTSMatcher, ParsesUsingDocLanguage) { // Test the matcher does not filter out stop words from positive terms TEST(FTSMatcher, MatcherDoesNotFilterStopWordsNeg) { FTSQuery q; - q.parse("-the", "none", false, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse("-the", "none", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" << "text"))))); @@ -124,7 +124,7 @@ TEST(FTSMatcher, MatcherDoesNotFilterStopWordsNeg) { // Test the matcher does not filter out stop words from negative terms TEST(FTSMatcher, MatcherDoesNotFilterStopWordsPos) { FTSQuery q; - q.parse("the", "none", false, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse("the", "none", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" << "text"))))); @@ -137,7 +137,7 @@ TEST(FTSMatcher, MatcherDoesNotFilterStopWordsPos) { // case-sensitive text query 'search'. static bool docHasPositiveTermWithCase(const std::string& doc, const std::string& search) { FTSQuery q; - q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" << "text"))))); @@ -164,7 +164,7 @@ TEST(FTSMatcher, HasPositiveTermCaseSensitive) { // case-sensitive text query 'search'. static bool docHasNegativeTermWithCase(const std::string& doc, const std::string& search) { FTSQuery q; - q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" << "text"))))); @@ -191,7 +191,7 @@ TEST(FTSMatcher, HasNegativeTermCaseSensitive) { // from case-sensitive text query 'search'. static bool docPositivePhrasesMatchWithCase(const std::string& doc, const std::string& search) { FTSQuery q; - q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" << "text"))))); @@ -214,7 +214,7 @@ TEST(FTSMatcher, PositivePhrasesMatchWithCase) { // from case-sensitive text query 'search'. static bool docNegativePhrasesMatchWithCase(const std::string& doc, const std::string& search) { FTSQuery q; - q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3); + ASSERT_OK(q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" << "text"))))); -- cgit v1.2.1