lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: svn commit: r1503837 - /lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TermFi lterTest.java
Date Tue, 16 Jul 2013 21:12:24 GMT

: This should fix this, b/c value2 (one extra character) will always be
: different than value1. The test initially failed b/c value1 and value2 were
: equal.

rmuir's point is that what you are describing is not garunteed to be true, 
because randomRealisticUnicodeString returns strings of random lengths as 
well (unless you specifiy minLength and maxLength)

The first call to randomRealisticUnicodeString(random()) might set value1 
to "foox" and the second call to randomRealisticUnicodeString(random()) 
might return "foo" making the value of value1 "foox" as well.

I think you just want something like:  String value2 = value1 + "x"



: On 16 July 2013 21:37, Robert Muir <rcmuir@gmail.com> wrote:
: 
: > Does this really fix this or just make it less likely to happen...?
: >
: >
: > On Tue, Jul 16, 2013 at 12:15 PM, <mvg@apache.org> wrote:
: >
: >>
: >>        String value1 = _TestUtil.randomRealisticUnicodeString(random());
: >> -      String value2 = _TestUtil.randomRealisticUnicodeString(random());
: >> +      String value2 = _TestUtil.randomRealisticUnicodeString(random()) +
: >> "x"; // this must be not equal to value1
: >>
: >
: 
: 
: -- 
: Met vriendelijke groet,
: 
: Martijn van Groningen
: 

-Hoss

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


Mime
View raw message