Skip to content

Commit

Permalink
Fixed Unit Tests
Browse files Browse the repository at this point in the history
Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>
  • Loading branch information
GabeFernandez310 committed Jan 6, 2023
1 parent 864099c commit a707e3f
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,53 +576,53 @@ public void relevanceMatch_Query() {
public void relevanceMatchQueryAltSyntax() {
assertEquals(AstDSL.function("match_query",
unresolvedArg("field", stringLiteral("message")),
unresolvedArg("query", stringLiteral("search query"))),
buildExprAst("message = match_query('search query')")
unresolvedArg("query", stringLiteral("search query"))).toString(),
buildExprAst("message = match_query('search query')").toString()
);

assertEquals(AstDSL.function("match_query",
unresolvedArg("field", stringLiteral("message")),
unresolvedArg("query", stringLiteral("search query"))),
buildExprAst("message = match_query(\"search query\")")
unresolvedArg("query", stringLiteral("search query"))).toString(),
buildExprAst("message = match_query(\"search query\")").toString()
);

assertEquals(AstDSL.function("matchquery",
unresolvedArg("field", stringLiteral("message")),
unresolvedArg("query", stringLiteral("search query"))),
buildExprAst("message = matchquery('search query')")
unresolvedArg("query", stringLiteral("search query"))).toString(),
buildExprAst("message = matchquery('search query')").toString()
);

assertEquals(AstDSL.function("matchquery",
unresolvedArg("field", stringLiteral("message")),
unresolvedArg("query", stringLiteral("search query"))),
buildExprAst("message = matchquery(\"search query\")")
unresolvedArg("query", stringLiteral("search query"))).toString(),
buildExprAst("message = matchquery(\"search query\")").toString()
);
}

@Test
public void relevanceMatchPhraseAltSyntax() {
assertEquals(AstDSL.function("match_phrase",
unresolvedArg("field", stringLiteral("message")),
unresolvedArg("query", stringLiteral("search query"))),
buildExprAst("message = match_phrase('search query')")
unresolvedArg("query", stringLiteral("search query"))).toString(),
buildExprAst("message = match_phrase('search query')").toString()
);

assertEquals(AstDSL.function("match_phrase",
unresolvedArg("field", stringLiteral("message")),
unresolvedArg("query", stringLiteral("search query"))),
buildExprAst("message = match_phrase(\"search query\")")
unresolvedArg("query", stringLiteral("search query"))).toString(),
buildExprAst("message = match_phrase(\"search query\")").toString()
);

assertEquals(AstDSL.function("matchphrase",
unresolvedArg("field", stringLiteral("message")),
unresolvedArg("query", stringLiteral("search query"))),
buildExprAst("message = matchphrase('search query')")
unresolvedArg("query", stringLiteral("search query"))).toString(),
buildExprAst("message = matchphrase('search query')").toString()
);

assertEquals(AstDSL.function("matchphrase",
unresolvedArg("field", stringLiteral("message")),
unresolvedArg("query", stringLiteral("search query"))),
buildExprAst("message = matchphrase(\"search query\")")
unresolvedArg("query", stringLiteral("search query"))).toString(),
buildExprAst("message = matchphrase(\"search query\")").toString()
);
}

Expand Down

0 comments on commit a707e3f

Please sign in to comment.