Fix test bug in TestStemmerOverrideFilter.

This test cannot pass with a random map if ignoring case since the map might
contain the same key twice (once lowercased and once uppercased).


git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1640159 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2014-11-17 13:53:41 +00:00
parent 8339fd8cfc
commit 1ecee51df4
1 changed files with 3 additions and 1 deletions

View File

@ -135,7 +135,9 @@ public class TestStemmerOverrideFilter extends BaseTokenStreamTestCase {
if (map.isEmpty()) {
map.put("booked", "books");
}
StemmerOverrideFilter.Builder builder = new StemmerOverrideFilter.Builder(random().nextBoolean());
// This test might fail if ignoreCase is true since the map might have twice the same key, once
// lowercased and once uppercased
StemmerOverrideFilter.Builder builder = new StemmerOverrideFilter.Builder(false);
Set<Entry<String,String>> entrySet = map.entrySet();
for (Entry<String,String> entry : entrySet) {
builder.add(entry.getKey(), entry.getValue());