|
@@ -18,6 +18,7 @@
|
|
|
|
|
|
package org.apache.hadoop.cli.util;
|
|
|
|
|
|
+import org.apache.hadoop.util.Shell;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
@@ -33,6 +34,10 @@ public class RegexpAcrossOutputComparator extends ComparatorBase {
|
|
|
|
|
|
@Override
|
|
|
public boolean compare(String actual, String expected) {
|
|
|
+ if (Shell.WINDOWS) {
|
|
|
+ actual = actual.replaceAll("\\r", "");
|
|
|
+ expected = expected.replaceAll("\\r", "");
|
|
|
+ }
|
|
|
return Pattern.compile(expected).matcher(actual).find();
|
|
|
}
|
|
|
|