harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elena Sayapina (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4458) [buildtest][func] One of testSplit test case checks of the functional org/apache/harmony/test/func/api/java/util/regex/Pattern/PatternTest test is incorrect
Date Fri, 13 Jul 2007 08:15:05 GMT
[buildtest][func] One of testSplit test case checks of the functional org/apache/harmony/test/func/api/java/util/regex/Pattern/PatternTest
test is incorrect
------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4458
                 URL: https://issues.apache.org/jira/browse/HARMONY-4458
             Project: Harmony
          Issue Type: Bug
          Components: build - test - ci
            Reporter: Elena Sayapina


One of testSplit test case checks of the functional org/apache/harmony/test/func/api/java/util/regex/Pattern/PatternTest
test is incorrect.
This causes the test fail on Harmony.

Test incorrecty assumes that "hex\u0561regex" sequence splitted by "\u0531" will produce "hex",
"regex" instead of "hex\u0561regex".

\u0561is unicode armenian small letter AYB, \u0531 is unicode armenian capital letter AYB,
So according to Java 1.5.0 API Spec if CASE_INSENSITIVE flag is not enabled than split should
produce "hex\u0561regex".

Please , see quotation from Java 1.5.0 API Spec:

"Class Pattern ...
Field Detail ...

UNICODE_CASE
public static final int UNICODE_CASE

Enables Unicode-aware case folding. 
When this flag is specified then case-insensitive matching, when enabled by the CASE_INSENSITIVE
flag, is done in a manner consistent with the Unicode Standard. By default, case-insensitive
matching assumes that only characters in the US-ASCII charset are being matched ..." 

Please, see PatternTest.java code:

------------------------------------ PatternTest.java -------------------------------------------------------
                 ...
line 353: p = Pattern.compile("\u0531", Pattern.UNICODE_CASE); //ARMENIAN CAPITAL
                 // LETTER AYB
                 sarr = p.split(new CharSeq("hex\u0561regex"));
                 expected = new String[] { "hex\u0561regex" };
                 if(System.getProperty("java.version").startsWith("1.5")) {
                     expected = new String[] { "hex", "regex" };
                 }

                 if (!Arrays.equals(sarr, expected)) {
                 return failed("'hex\\u0561regex' split on '\\u0531' produced with UNICODE_CASE
"
                    + toString(sarr) + ", expected " + toString(expected));
line 364: }
                 ...                  
------------------------------------------------------------------------------------------------------------------------

Suggest to remove incorrect code.

Note that test passes on RI, possibly because of RI bug.



 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message