diff --git a/src/com/nobigsoftware/dfalex/StringSearcher.java b/src/com/nobigsoftware/dfalex/StringSearcher.java index c1acfb1..fcf2b01 100644 --- a/src/com/nobigsoftware/dfalex/StringSearcher.java +++ b/src/com/nobigsoftware/dfalex/StringSearcher.java @@ -99,7 +99,7 @@ public StringMatchIterator searchString(String src) { //need a longer array int toadd = Math.max(maskStartPos-pos, maskArray.length<<5); - toadd = (toadd|31)>>5; //bits to ints + toadd = (toadd+31)>>5; //bits to ints int[] newMask = new int[maskArray.length + toadd]; for (int i=0;i + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + aalto-xml + ${java.version} + **/*$* + failing/*.java + + ${surefire.format} + ${surefire.usefile} + ${surefire.fork.mode} + false + ${surefire.fork.vmargs} + + + java.awt.headless + ${java.awt.headless} + + + surefire.fork.vmargs + ${surefire.fork.vmargs} diff --git a/test/com/nobigsoftware/dfalex/StringSearcherTest.java b/test/com/nobigsoftware/dfalex/StringSearcherTest.java index e1ccb54..a41da90 100644 --- a/test/com/nobigsoftware/dfalex/StringSearcherTest.java +++ b/test/com/nobigsoftware/dfalex/StringSearcherTest.java @@ -22,6 +22,18 @@ public void test() throws Exception Assert.assertEquals(want, have); } + @Test + public void crazyWontonTest() throws Exception + { + SearchAndReplaceBuilder builder = new SearchAndReplaceBuilder(); + builder.addReplacement(Pattern.regexI("()"), StringReplacements.DELETE); + Function replacer = builder.buildStringReplacer(); + String instr = _readResource("SearcherTestInput2.txt"); + String have = replacer.apply(instr); + String want = instr.replaceAll("","").replaceAll("",""); + Assert.assertEquals(want, have); + } + @Test public void testReplaceFunc() throws Exception {