harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Fedotov" <alexei.fedo...@gmail.com>
Subject [drlvm][regression] org.apache.harmony.tests.java.util.regex.PatternTest fails Was: svn commit: r475869 - in /incubator/harmony/enhanced/classlib/trunk/modules/regex/src: main/java/java/util/regex/Lexer.java test/java/org/apache/harmony/tests/java/ut
Date Sat, 18 Nov 2006 01:14:43 GMT
All,
It looks like we've got a regression, see
http://harmonytest.org/testapp.do?method=showresult&id=2293852.

org.apache.harmony.tests.java.util.regex.PatternTest@testMatches:
java.util.regex.PatternSyntaxException: Illegal inline construct near index: 3
x(?c)y^
at java.util.regex.Lexer.readFlags(Lexer.java:1097)
at java.util.regex.Lexer.movePointer(Lexer.java:749)
at java.util.regex.Lexer.<init>(Lexer.java:228)
at java.util.regex.Pattern.compileImpl(Pattern.java:279)
at java.util.regex.Pattern.compile(Pattern.java:264)
at java.util.regex.Pattern.compile(Pattern.java)
at java.util.regex.Pattern.matches(Pattern.java)
at org.apache.harmony.tests.java.util.regex.PatternTest.testMatches(PatternTest.java:431)
at java.lang.reflect.VMReflection.invokeMethod(Native Method)


Thanks!


On 11/16/06, pyang@apache.org <pyang@apache.org> wrote:
> Author: pyang
> Date: Thu Nov 16 10:57:47 2006
> New Revision: 475869
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=475869
> Log:
> Apply patch for HARMONY-2127 ([classlib][regex] harmony does not compile embedded flag
(?c))
>
> Modified:
>    incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/Lexer.java
>    incubator/harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java
>
> Modified: incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/Lexer.java
> URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/Lexer.java?view=diff&rev=475869&r1=475868&r2=475869
> ==============================================================================
> --- incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/Lexer.java
(original)
> +++ incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/Lexer.java
Thu Nov 16 10:57:47 2006
> @@ -1093,8 +1093,7 @@
>                 return res | (1 << 8);
>
>             default:
> -                throw new PatternSyntaxException(Messages.getString("regex.1A"), //$NON-NLS-1$
> -                                               this.toString(), index);
> +                // ignore invalid flags (HARMONY-2127)
>             }
>             nextIndex();
>         }
>
> Modified: incubator/harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java
> URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java?view=diff&rev=475869&r1=475868&r2=475869
> ==============================================================================
> --- incubator/harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java
(original)
> +++ incubator/harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/PatternTest.java
Thu Nov 16 10:57:47 2006
> @@ -31,7 +31,10 @@
>                        "(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ)*",
>                        "(a|b)*(a|b)*A(a|b)*lice.*",
>                        "(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)(a|b|c|d|e|f|g|h|"
> -                                       + "i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)*(1|2|3|4|5|6|7|8|9|0)*|while|for|struct|if|do"
> +                                       + "i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)*(1|2|3|4|5|6|7|8|9|0)*|while|for|struct|if|do",
> +             "x(?c)y",
> +             "x(?cc)y",
> +             "x(?:c)y"
>
>        };
>
> @@ -322,38 +325,49 @@
>                 */
>                String pattern = "b)a";
>                try {
> -                       Pattern pat = Pattern.compile(pattern);
> +                       Pattern.compile(pattern);
> +            fail("Expected a PatternSyntacException when compiling pattern: " + pattern);
>                } catch (PatternSyntaxException e) {
> -                       System.out.println(e);
> +                       // pass
>                }
>                pattern = "bcde)a";
>                try {
> -                       Pattern pat = Pattern.compile(pattern);
> +                       Pattern.compile(pattern);
> +            fail("Expected a PatternSyntacException when compiling pattern: " + pattern);
>                } catch (PatternSyntaxException e) {
> -                       System.out.println(e);
> +                       // pass
>                }
>                pattern = "bbg())a";
>                try {
>                        Pattern pat = Pattern.compile(pattern);
> +            fail("Expected a PatternSyntacException when compiling pattern: " + pattern);
>                } catch (PatternSyntaxException e) {
> -                       System.out.println(e);
> +                       // pass
>                }
>
>                pattern = "cdb(?i))a";
>                try {
>                        Pattern pat = Pattern.compile(pattern);
> -               } catch (Exception e) {
> -                       System.out.println(e);
> +            fail("Expected a PatternSyntacException when compiling pattern: " + pattern);
> +               } catch (PatternSyntaxException e) {
> +                       // pass
>                }
> +
> +        /*
> +         * This pattern should compile - HARMONY-2127
> +         */
> +        pattern = "x(?c)y";
> +        Pattern.compile(pattern);
> +
>
>                /*
>                 * this pattern doesn't match any string, but should be compiled anyway
>                 */
>                pattern = "(b\\1)a";
> -               Pattern pat = Pattern.compile(pattern);
> +               Pattern.compile(pattern);
>
>        }
> -
> +
>        /*
>         * Class under test for Pattern compile(String)
>         */
> @@ -403,7 +417,10 @@
>                                                                + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
},
>                                { "ababbaAabababblice", "ababbaAliceababab", "ababbAabliceaaa",
>                                                "abbbAbbbliceaaa", "Alice" },
> -                               { "a123", "bnxnvgds156", "for", "while", "if", "struct"
}
> +                               { "a123", "bnxnvgds156", "for", "while", "if", "struct"
},
> +                { "xy" },
> +                { "xy" },
> +                { "xcy" }
>
>                };
>
> @@ -414,7 +431,7 @@
>                                                posSeq[i][j]));
>                        }
>                }
> -       }
> +       }
>
>        public void testTimeZoneIssue() {
>                Pattern p = Pattern.compile("GMT(\\+|\\-)(\\d+)(:(\\d+))?");
>
>
>


-- 
Thank you,
Alexei

Mime
View raw message