Browse Source

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
master
Stephane Bailliez 23 years ago
parent
commit
e27d594005
4 changed files with 73 additions and 3 deletions
  1. +31
    -0
      src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java
  2. +3
    -3
      src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java
  3. +36
    -0
      src/testcases/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java
  4. +3
    -0
      src/testcases/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java

+ 31
- 0
src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java View File

@@ -54,6 +54,12 @@


package org.apache.tools.ant.util.regexp; 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. * Tests for the jakarta-regexp implementation of the RegexpMatcher interface.
* *
@@ -69,6 +75,31 @@ public class JakartaRegexpMatcherTest extends RegexpMatcherTest {
super(name); 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. * Fails for "default" mode.
*/ */


+ 3
- 3
src/testcases/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java View File

@@ -75,15 +75,15 @@ public class JakartaRegexpRegexpTest extends RegexpTest {
super(name); super(name);
} }


public void testWindowsLineSeparator() throws IOException {
public void testWindowsLineSeparator2() throws IOException {
if ( Os.isFamily("windows") ) { if ( Os.isFamily("windows") ) {
try { try {
super.testWindowsLineSeparator();
super.testWindowsLineSeparator2();
fail("Windows issue. Should trigger when this bug is fixed. {@since 1.2}"); fail("Windows issue. Should trigger when this bug is fixed. {@since 1.2}");
} catch (AssertionFailedError e){ } catch (AssertionFailedError e){
} }
} else { } else {
super.testWindowsLineSeparator();
super.testWindowsLineSeparator2();
} }
} }




+ 36
- 0
src/testcases/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java View File

@@ -54,6 +54,10 @@


package org.apache.tools.ant.util.regexp; 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. * Tests for the JDK 1.4 implementation of the Regexp interface.
* *
@@ -69,4 +73,36 @@ public class Jdk14RegexpRegexpTest extends RegexpTest {
super(name); 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){
}
}

} }

+ 3
- 0
src/testcases/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java View File

@@ -167,6 +167,9 @@ public abstract class RegexpMatcherTest extends TestCase {
public void testWindowsLineSeparator() throws IOException { public void testWindowsLineSeparator() throws IOException {
reg.setPattern("end of text$"); reg.setPattern("end of text$");
assertTrue("Windows line separator", !reg.matches("end of text\r\n")); assertTrue("Windows line separator", !reg.matches("end of text\r\n"));
}

public void testWindowsLineSeparator2() throws IOException {
reg.setPattern("end of text\r$"); reg.setPattern("end of text\r$");
assertTrue("Windows line separator", reg.matches("end of text\r\n")); assertTrue("Windows line separator", reg.matches("end of text\r\n"));
} }


Loading…
Cancel
Save