lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: svn commit: r1001318 - in /lucene/dev/trunk/solr: CHANGES.txt src/java/org/apache/solr/search/FunctionQParser.java src/test/org/apache/solr/search/QueryParsingTest.java src/test/org/apache/solr/search/function/TestFunctionQuery.java
Date Thu, 02 Dec 2010 18:34:02 GMT
On Thu, Dec 2, 2010 at 12:58 PM, Grant Ingersoll <gsingers@apache.org> wrote:
[...]
>     flds = sort.getSort();
>     assertEquals(flds[0].getType(), SortField.FLOAT);
>     assertEquals(flds[0].getField(), "weight");
> -
> -    try {
> -      //bad number of parens, but the function parser can handle an extra
> close
> -      sort = QueryParsing.parseSort("pow(weight,2)) desc, bday asc",
> schema);
> -    } catch (SolrException e) {
> -      assertTrue(false);
> -    }
> +gvim
>     //Test literals in functions
>     sort = QueryParsing.parseSort("strdist(foo_s, \"junk\", jw) desc",
> schema);
>     flds = sort.getSort();
>
> Namely, it looks like like we had a test that checked for dealing with extra
> parens.

> Then, perhaps you made some typo that inserted the chars: gvim in
> place of that test.

Yeah - the window you see isn't necessarily the window that has the focus :-(

>  Subsequently in rev 1001320 you kind of reverted the
> commit by removing the gvim, but did you intend to restore the test or are
> you seeing it as a bad test?

It was a bad test.
Tests should test for desired functionality, not quirks or
implementation details of the current implementation.
The fact that the past implementation did not error on something like
"add(a,b))"
was a quirk/bug, not a feature.

-Yonik
http://www.lucidimagination.com

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


Mime
View raw message