From e27d594005ff7ae3d1a5d0e3f448745892de1025 Mon Sep 17 00:00:00 2001 From: Stephane Bailliez Date: Wed, 30 Jan 2002 22:43:57 +0000 Subject: [PATCH] Fixes should be in all related testcases now. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271017 13f79535-47bb-0310-9956-ffa450edef68 --- .../util/regexp/JakartaRegexpMatcherTest.java | 31 ++++++++++++++++ .../util/regexp/JakartaRegexpRegexpTest.java | 6 ++-- .../util/regexp/Jdk14RegexpRegexpTest.java | 36 +++++++++++++++++++ .../ant/util/regexp/RegexpMatcherTest.java | 3 ++ 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java b/src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java index a56a29f19..d919727b5 100644 --- a/src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java +++ b/src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java @@ -54,6 +54,12 @@ package org.apache.tools.ant.util.regexp; +import java.io.IOException; + +import junit.framework.AssertionFailedError; + +import org.apache.tools.ant.taskdefs.condition.Os; + /** * Tests for the jakarta-regexp implementation of the RegexpMatcher interface. * @@ -69,6 +75,31 @@ public class JakartaRegexpMatcherTest extends RegexpMatcherTest { super(name); } + public void testWindowsLineSeparator2() throws IOException { + if ( Os.isFamily("windows") ) { + try { + super.testWindowsLineSeparator2(); + fail("Windows issue. Should trigger when this bug is fixed. {@since 1.2}"); + } catch (AssertionFailedError e){ + } + } else { + super.testWindowsLineSeparator2(); + } + } + + public void testUnixLineSeparator() throws IOException { + if ( Os.isFamily("windows") ){ + try { + super.testUnixLineSeparator(); + fail("Windows issue. Should trigger once this bug is fixed. {@since 1.2}"); + } catch (AssertionFailedError e){ + } + } else { + super.testUnixLineSeparator(); + } + } + + /** * Fails for "default" mode. */ diff --git a/src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java b/src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java index 9ede03cb9..116a709b1 100644 --- a/src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java +++ b/src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java @@ -75,15 +75,15 @@ public class JakartaRegexpRegexpTest extends RegexpTest { super(name); } - public void testWindowsLineSeparator() throws IOException { + public void testWindowsLineSeparator2() throws IOException { if ( Os.isFamily("windows") ) { try { - super.testWindowsLineSeparator(); + super.testWindowsLineSeparator2(); fail("Windows issue. Should trigger when this bug is fixed. {@since 1.2}"); } catch (AssertionFailedError e){ } } else { - super.testWindowsLineSeparator(); + super.testWindowsLineSeparator2(); } } diff --git a/src/testcases/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java b/src/testcases/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java index 88247c3d3..7adddec4c 100644 --- a/src/testcases/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java +++ b/src/testcases/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java @@ -54,6 +54,10 @@ package org.apache.tools.ant.util.regexp; +import java.io.IOException; + +import junit.framework.AssertionFailedError; + /** * Tests for the JDK 1.4 implementation of the Regexp interface. * @@ -69,4 +73,36 @@ public class Jdk14RegexpRegexpTest extends RegexpTest { super(name); } + public void testParagraphCharacter() throws IOException { + try { + super.testParagraphCharacter(); + fail("Should trigger once fixed. {@since JDK 1.4RC1}"); + } catch (AssertionFailedError e){ + } + } + + public void testLineSeparatorCharacter() throws IOException { + try { + super.testLineSeparatorCharacter(); + fail("Should trigger once fixed. {@since JDK 1.4RC1}"); + } catch (AssertionFailedError e){ + } + } + + public void testStandaloneCR() throws IOException { + try { + super.testStandaloneCR(); + fail("Should trigger once fixed. {@since JDK 1.4RC1}"); + } catch (AssertionFailedError e){ + } + } + + public void testWindowsLineSeparator() throws IOException { + try { + super.testWindowsLineSeparator(); + fail("Should trigger once fixed. {@since JDK 1.4RC1}"); + } catch (AssertionFailedError e){ + } + } + } diff --git a/src/testcases/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java b/src/testcases/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java index 6a81e0e85..44d0b4b44 100644 --- a/src/testcases/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java +++ b/src/testcases/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java @@ -167,6 +167,9 @@ public abstract class RegexpMatcherTest extends TestCase { public void testWindowsLineSeparator() throws IOException { reg.setPattern("end of text$"); assertTrue("Windows line separator", !reg.matches("end of text\r\n")); + } + + public void testWindowsLineSeparator2() throws IOException { reg.setPattern("end of text\r$"); assertTrue("Windows line separator", reg.matches("end of text\r\n")); }