: 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 <[email protected]> wrote: : : > Does this really fix this or just make it less likely to happen...? : > : > : > On Tue, Jul 16, 2013 at 12:15 PM, <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
