lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/queryParser TestQueryParser.java
Date Tue, 29 Apr 2003 01:34:01 GMT
otis        2003/04/28 18:34:01

  Modified:    src/java/org/apache/lucene/search RangeQuery.java
               src/test/org/apache/lucene/queryParser TestQueryParser.java
  Log:
  - Modified RangeQuery's toString() method to return a String that matches the syntax used
in QueryParser.
  
  Revision  Changes    Path
  1.8       +1 -1      jakarta-lucene/src/java/org/apache/lucene/search/RangeQuery.java
  
  Index: RangeQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/RangeQuery.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RangeQuery.java	29 Jan 2003 17:18:55 -0000	1.7
  +++ RangeQuery.java	29 Apr 2003 01:34:00 -0000	1.8
  @@ -156,7 +156,7 @@
           }
           buffer.append(inclusive ? "[" : "{");
           buffer.append(lowerTerm != null ? lowerTerm.text() : "null");
  -        buffer.append("-");
  +        buffer.append(" TO ");
           buffer.append(upperTerm != null ? upperTerm.text() : "null");
           buffer.append(inclusive ? "]" : "}");
           if (getBoost() != 1.0f)
  
  
  
  1.21      +12 -12    jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java
  
  Index: TestQueryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TestQueryParser.java	2 Mar 2003 02:47:01 -0000	1.20
  +++ TestQueryParser.java	29 Apr 2003 01:34:00 -0000	1.21
  @@ -305,16 +305,16 @@
       }
   
       public void testRange() throws Exception {
  -	assertQueryEquals("[ a TO z]", null, "[a-z]");
  +	assertQueryEquals("[ a TO z]", null, "[a TO z]");
   	assertTrue(getQuery("[ a TO z]", null) instanceof RangeQuery);
  -	assertQueryEquals("[ a TO z ]", null, "[a-z]");
  -	assertQueryEquals("{ a TO z}", null, "{a-z}");
  -	assertQueryEquals("{ a TO z }", null, "{a-z}");
  -	assertQueryEquals("{ a TO z }^2.0", null, "{a-z}^2.0");
  -	assertQueryEquals("[ a TO z] OR bar", null, "[a-z] bar");
  -	assertQueryEquals("[ a TO z] AND bar", null, "+[a-z] +bar");
  -	assertQueryEquals("( bar blar { a TO z}) ", null, "bar blar {a-z}");
  -	assertQueryEquals("gack ( bar blar { a TO z}) ", null, "gack (bar blar {a-z})");
  +	assertQueryEquals("[ a TO z ]", null, "[a TO z]");
  +	assertQueryEquals("{ a TO z}", null, "{a TO z}");
  +	assertQueryEquals("{ a TO z }", null, "{a TO z}");
  +	assertQueryEquals("{ a TO z }^2.0", null, "{a TO z}^2.0");
  +	assertQueryEquals("[ a TO z] OR bar", null, "[a TO z] bar");
  +	assertQueryEquals("[ a TO z] AND bar", null, "+[a TO z] +bar");
  +	assertQueryEquals("( bar blar { a TO z}) ", null, "bar blar {a TO z}");
  +	assertQueryEquals("gack ( bar blar { a TO z}) ", null, "gack (bar blar {a TO z})");
       }
   
       public String getDate(String s) throws Exception {
  @@ -333,9 +333,9 @@
       String startDate = getLocalizedDate(2002, 1, 1);
       String endDate = getLocalizedDate(2002, 1, 4);
   	assertQueryEquals("[ " + startDate + " TO " + endDate + "]", null,
  -	    "[" + getDate(startDate) + "-" + getDate(endDate) + "]");
  +	    "[" + getDate(startDate) + " TO " + getDate(endDate) + "]");
   	assertQueryEquals("{  " + startDate + "    " + endDate + "   }", null,
  -	    "{" + getDate(startDate) + "-" + getDate(endDate) + "}");
  +	    "{" + getDate(startDate) + " TO " + getDate(endDate) + "}");
       }
   
       public void testEscaped() throws Exception {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message