You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2013/07/16 23:12:24 UTC

Re: svn commit: r1503837 - /lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TermFi lterTest.java

: 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 <rc...@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, <mv...@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


Re: svn commit: r1503837 - /lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/TermFi lterTest.java

Posted by Martijn v Groningen <ma...@gmail.com>.
True, I misunderstood Robert
and_TestUtil#randomRealisticUnicodeString(random). I will change the test.
Thanks for pointing this out to me.


On 16 July 2013 23:12, Chris Hostetter <ho...@fucit.org> wrote:

>
> : 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 <rc...@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, <mv...@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
>
>


-- 
Met vriendelijke groet,

Martijn van Groningen