lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/queryParser TestQueryParser.java
Date Wed, 15 Sep 2004 19:45:02 GMT
dnaber      2004/09/15 12:45:02

  Modified:    src/test/org/apache/lucene/queryParser TestQueryParser.java
  Log:
  test if fuzzy query throws ParseException, test getter methods
  
  Revision  Changes    Path
  1.31      +12 -0     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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- TestQueryParser.java	14 Sep 2004 13:46:25 -0000	1.30
  +++ TestQueryParser.java	15 Sep 2004 19:45:02 -0000	1.31
  @@ -246,6 +246,18 @@
       assertTrue(getQuery("term*^2", null) instanceof PrefixQuery);
       assertTrue(getQuery("term~", null) instanceof FuzzyQuery);
       assertTrue(getQuery("term~0.7", null) instanceof FuzzyQuery);
  +    FuzzyQuery fq = (FuzzyQuery)getQuery("term~0.7", null);
  +    assertEquals(0.7f, fq.getMinSimilarity(), 0.1f);
  +    assertEquals(0, fq.getPrefixLength());
  +    fq = (FuzzyQuery)getQuery("term~", null);
  +    assertEquals(0.5f, fq.getMinSimilarity(), 0.1f);
  +    assertEquals(0, fq.getPrefixLength());
  +    try {
  +      getQuery("term~1.1", null);   // value > 1, throws exception
  +      fail();
  +    } catch(ParseException pe) {
  +      // expected exception
  +    }
       assertTrue(getQuery("term*germ", null) instanceof WildcardQuery);
   
   /* Tests to see that wild card terms are (or are not) properly
  
  
  

---------------------------------------------------------------------
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