diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-10-26 11:20:12 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-10-26 15:07:07 -0400 |
commit | 1c91d1a2b789fef8be6427de81c35658ff30009d (patch) | |
tree | baf49d48e66a16b774b41b7647f32cd9bbd2e212 /src/mongo/db/fts/fts_matcher_test.cpp | |
parent | 75689917412c571427f12b7fe29a4dfa458d2df3 (diff) | |
download | mongo-1c91d1a2b789fef8be6427de81c35658ff30009d.tar.gz |
Revert "SERVER-20888: Defer $language check to FTSQuery::Parse"
This reverts commit 4c38ff13739e60d33d52b0c944d55249e7d9cc68.
Diffstat (limited to 'src/mongo/db/fts/fts_matcher_test.cpp')
-rw-r--r-- | src/mongo/db/fts/fts_matcher_test.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
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"))))); |