From 93201959b8aa6b660b6bfd8793b841f139d12414 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 13 May 2013 17:23:03 +0000 Subject: [PATCH] SOLR-4785: add gbowyer's tests to unbreak build git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1481977 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/solr/search/QueryEqualityTest.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java b/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java index cb1b666a17b..0a3ebe266d2 100644 --- a/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java +++ b/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java @@ -32,8 +32,8 @@ import org.junit.BeforeClass; /** * Sanity checks that queries (generated by the QParser and ValueSourceParser - * framework) are appropraitely {@link Object#equals} and - * {@link Object#hashCode()} equivilent. If you are adding a new default + * framework) are appropriately {@link Object#equals} and + * {@link Object#hashCode()} equivalent. If you are adding a new default * QParser or ValueSourceParser, you will most likely get a failure from * {@link #testParserCoverage} until you add a new test method to this class. * @@ -76,7 +76,7 @@ public class QueryEqualityTest extends SolrTestCaseJ4 { public void testDateMathParsingEquality() throws Exception { - // regardless of parser, these should all be equivilent queries + // regardless of parser, these should all be equivalent queries assertQueryEquals (null ,"{!lucene}f_tdt:2013-09-11T00\\:00\\:00Z" @@ -704,6 +704,18 @@ public class QueryEqualityTest extends SolrTestCaseJ4 { assertFuncEquals("sleep(1,5)", "sleep(1,5)"); assertFuncEquals("threadid()", "threadid()"); } + + // TODO: more tests + public void testQueryMaxScore() throws Exception { + assertQueryEquals("maxscore", "{!maxscore}A OR B OR C", + "A OR B OR C"); + assertQueryEquals("maxscore", "{!maxscore}A AND B", + "A AND B"); + assertQueryEquals("maxscore", "{!maxscore}apache -solr", + "apache -solr", "apache -solr "); + assertQueryEquals("maxscore", "+apache +solr", "apache AND solr", + "+apache +solr"); + } /** * this test does not assert anything itself, it simply toggles a static