From 09ccd41e2ee8076e1d491a283b7cf35c59357198 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sun, 14 Mar 2010 23:47:00 +0000 Subject: [PATCH] fix bad tests: you cannot test a posInc that does not exist (e.g. some stopfilter etc must set it first) git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/branches/solr@923008 13f79535-47bb-0310-9956-ffa450edef68 --- .../TestPatternReplaceCharFilter.java | 24 +++++++------------ .../analysis/TestPatternTokenizerFactory.java | 6 ++--- .../TestReversedWildcardFilterFactory.java | 3 +-- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/test/org/apache/solr/analysis/TestPatternReplaceCharFilter.java b/src/test/org/apache/solr/analysis/TestPatternReplaceCharFilter.java index 3241da80914..bd36b721ac2 100644 --- a/src/test/org/apache/solr/analysis/TestPatternReplaceCharFilter.java +++ b/src/test/org/apache/solr/analysis/TestPatternReplaceCharFilter.java @@ -51,8 +51,7 @@ public class TestPatternReplaceCharFilter extends BaseTokenTestCase { assertTokenStreamContents(ts, new String[] { "this", "is", "test." }, new int[] { 0, 5, 8 }, - new int[] { 4, 7, 13 }, - new int[] { 1, 1, 1 }); + new int[] { 4, 7, 13 }); } // 012345678 @@ -85,8 +84,7 @@ public class TestPatternReplaceCharFilter extends BaseTokenTestCase { assertTokenStreamContents(ts, new String[] { "aa#bb#cc" }, new int[] { 0 }, - new int[] { 8 }, - new int[] { 1 }); + new int[] { 8 }); } // 11111 @@ -101,8 +99,7 @@ public class TestPatternReplaceCharFilter extends BaseTokenTestCase { assertTokenStreamContents(ts, new String[] { "aa##bb###cc", "dd" }, new int[] { 0, 9 }, - new int[] { 8, 11 }, - new int[] { 1, 1 }); + new int[] { 8, 11 }); } // 01234567 @@ -116,8 +113,7 @@ public class TestPatternReplaceCharFilter extends BaseTokenTestCase { assertTokenStreamContents(ts, new String[] { "aa", "aa" }, new int[] { 1, 4 }, - new int[] { 2, 5 }, - new int[] { 1, 1 }); + new int[] { 2, 5 }); } // 11111 @@ -132,8 +128,7 @@ public class TestPatternReplaceCharFilter extends BaseTokenTestCase { assertTokenStreamContents(ts, new String[] { "aa#bb", "dd" }, new int[] { 0, 12 }, - new int[] { 11, 14 }, - new int[] { 1, 1 }); + new int[] { 11, 14 }); } // 111111111122222222223333 @@ -148,8 +143,7 @@ public class TestPatternReplaceCharFilter extends BaseTokenTestCase { assertTokenStreamContents(ts, new String[] { "aa", "bb", "cc", "---", "aa", "bb", "aa", "bb", "cc" }, new int[] { 2, 6, 9, 11, 15, 18, 21, 25, 29 }, - new int[] { 4, 8, 10, 14, 17, 20, 23, 27, 33 }, - new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 }); + new int[] { 4, 8, 10, 14, 17, 20, 23, 27, 33 }); } // 11111111112222222222333333333 @@ -164,8 +158,7 @@ public class TestPatternReplaceCharFilter extends BaseTokenTestCase { assertTokenStreamContents(ts, new String[] { "aa##bb", "cc", "---", "aa##bb", "aa.", "bb", "aa##bb", "cc" }, new int[] { 2, 8, 11, 15, 21, 25, 28, 36 }, - new int[] { 7, 10, 14, 20, 24, 27, 35, 38 }, - new int[] { 1, 1, 1, 1, 1, 1, 1, 1 }); + new int[] { 7, 10, 14, 20, 24, 27, 35, 38 }); } // 11111111112222222222333333333 @@ -182,8 +175,7 @@ public class TestPatternReplaceCharFilter extends BaseTokenTestCase { assertTokenStreamContents(ts, new String[] { "aa", "b", "-", "c", ".", "---", "b", "aa", ".", "c", "c", "b" }, new int[] { 1, 3, 6, 8, 12, 14, 18, 21, 23, 25, 29, 33 }, - new int[] { 2, 5, 7, 11, 13, 17, 20, 22, 24, 28, 32, 35 }, - new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }); + new int[] { 2, 5, 7, 11, 13, 17, 20, 22, 24, 28, 32, 35 }); } private Pattern pattern( String p ){ diff --git a/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java b/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java index 7b59dbbb4f1..eecf48c1141 100644 --- a/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java +++ b/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java @@ -97,8 +97,7 @@ public class TestPatternTokenizerFactory extends BaseTokenTestCase assertTokenStreamContents(stream, new String[] { "Günther", "Günther", "is", "here" }, new int[] { 0, 13, 26, 29 }, - new int[] { 12, 25, 28, 33 }, - new int[] { 1, 1, 1, 1 }); + new int[] { 12, 25, 28, 33 }); charStream = new MappingCharFilter( normMap, CharReader.get( new StringReader( INPUT ) ) ); args.put( PatternTokenizerFactory.PATTERN, "Günther" ); @@ -109,8 +108,7 @@ public class TestPatternTokenizerFactory extends BaseTokenTestCase assertTokenStreamContents(stream, new String[] { "Günther", "Günther" }, new int[] { 0, 13 }, - new int[] { 12, 25 }, - new int[] { 1, 1 }); + new int[] { 12, 25 }); } /** diff --git a/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java b/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java index 55e4ac0c779..e310206f3e1 100644 --- a/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java +++ b/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java @@ -97,8 +97,7 @@ public class TestReversedWildcardFilterFactory extends AbstractSolrTestCase { assertTokenStreamContents(input, new String[] { "one", "two", "three", "si\uD834\uDD1Ex" }, new int[] { 0, 4, 8, 14 }, - new int[] { 3, 7, 13, 19 }, - new int[] { 1, 1, 1, 1 } + new int[] { 3, 7, 13, 19 } ); }