< prev index next >

test/jdk/java/lang/String/CompactString/RegionMatches.java

Print this page

  1 /*
  2  * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */

 79                 new Object[] { STRING_SUPPLEMENTARY, true, 0, "\uD802\uDC00\uD801\uDC01\uFF21A", 0, 2, false },
 80                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, false, 0,
 81                         "\uD801\uDC28\uD801\uDC29", 0, 4, true },
 82                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 0,
 83                         "\uD801\uDC00\uD801\uDC01", 0, 4, true },
 84                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 1,
 85                         "\uDC28\uD801", 0, 2, true },
 86                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 1,
 87                         "\uDC00", 0, 1, false },
 88                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 1,
 89                         "\uDC00\uD801", 0, 2, false },
 90                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 4,
 91                         "\uFF21", 0, 1, true },
 92                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, false, 4,
 93                         "\uFF21", 0, 1, false },
 94                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, false, 4,
 95                         "\uFF41", 0, 1, true },
 96                 // Turkish I with dot
 97                 new Object[] { "\u0130", false, 0, "i", 0, 1, false },
 98                 new Object[] { "\u0130", true,  0, "i", 0, 1, true },


 99                 // i without dot
100                 new Object[] { "\u0131", false, 0, "i", 0, 1, false },
101                 new Object[] { "\u0131", true,  0, "i", 0, 1, true },


102                 // Exhaustive list of 1-char latin1 strings that match
103                 // case-insensitively:
104                 // for (char c1 = 0; c1 < 255; c1++) {
105                 //   for (char c2 = c; c2 < 255; c2++) {
106                 //     if (c1 == c2) continue;
107                 //     if (String.valueOf(c1).regionMatches(true, 0, String.valueOf(c2), 0, 1)) {
108                 //       System.out.println("                new Object[] { \"\\u00"
109                 //                          + Integer.toHexString((int)c) + "\", true, 0, \"\\u00"
110                 //                          + Integer.toHexString((int)c2) + "\", 0, 1, true },");
111                 // }}}
112                 new Object[] { "\u0041", true, 0, "\u0061", 0, 1, true },
113                 new Object[] { "\u0042", true, 0, "\u0062", 0, 1, true },
114                 new Object[] { "\u0043", true, 0, "\u0063", 0, 1, true },
115                 new Object[] { "\u0044", true, 0, "\u0064", 0, 1, true },
116                 new Object[] { "\u0045", true, 0, "\u0065", 0, 1, true },
117                 new Object[] { "\u0046", true, 0, "\u0066", 0, 1, true },
118                 new Object[] { "\u0047", true, 0, "\u0067", 0, 1, true },
119                 new Object[] { "\u0048", true, 0, "\u0068", 0, 1, true },
120                 new Object[] { "\u0049", true, 0, "\u0069", 0, 1, true },
121                 new Object[] { "\u004a", true, 0, "\u006a", 0, 1, true },

  1 /*
  2  * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */

 79                 new Object[] { STRING_SUPPLEMENTARY, true, 0, "\uD802\uDC00\uD801\uDC01\uFF21A", 0, 2, false },
 80                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, false, 0,
 81                         "\uD801\uDC28\uD801\uDC29", 0, 4, true },
 82                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 0,
 83                         "\uD801\uDC00\uD801\uDC01", 0, 4, true },
 84                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 1,
 85                         "\uDC28\uD801", 0, 2, true },
 86                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 1,
 87                         "\uDC00", 0, 1, false },
 88                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 1,
 89                         "\uDC00\uD801", 0, 2, false },
 90                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, true, 4,
 91                         "\uFF21", 0, 1, true },
 92                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, false, 4,
 93                         "\uFF21", 0, 1, false },
 94                 new Object[] { STRING_SUPPLEMENTARY_LOWERCASE, false, 4,
 95                         "\uFF41", 0, 1, true },
 96                 // Turkish I with dot
 97                 new Object[] { "\u0130", false, 0, "i", 0, 1, false },
 98                 new Object[] { "\u0130", true,  0, "i", 0, 1, true },
 99                 new Object[] { "\u0130", false, 0, "I", 0, 1, false },
100                 new Object[] { "\u0130", true,  0, "I", 0, 1, true },
101                 // i without dot
102                 new Object[] { "\u0131", false, 0, "i", 0, 1, false },
103                 new Object[] { "\u0131", true,  0, "i", 0, 1, true },
104                 new Object[] { "\u0131", false, 0, "I", 0, 1, false },
105                 new Object[] { "\u0131", true,  0, "I", 0, 1, true },
106                 // Exhaustive list of 1-char latin1 strings that match
107                 // case-insensitively:
108                 // for (char c1 = 0; c1 < 255; c1++) {
109                 //   for (char c2 = c; c2 < 255; c2++) {
110                 //     if (c1 == c2) continue;
111                 //     if (String.valueOf(c1).regionMatches(true, 0, String.valueOf(c2), 0, 1)) {
112                 //       System.out.println("                new Object[] { \"\\u00"
113                 //                          + Integer.toHexString((int)c) + "\", true, 0, \"\\u00"
114                 //                          + Integer.toHexString((int)c2) + "\", 0, 1, true },");
115                 // }}}
116                 new Object[] { "\u0041", true, 0, "\u0061", 0, 1, true },
117                 new Object[] { "\u0042", true, 0, "\u0062", 0, 1, true },
118                 new Object[] { "\u0043", true, 0, "\u0063", 0, 1, true },
119                 new Object[] { "\u0044", true, 0, "\u0064", 0, 1, true },
120                 new Object[] { "\u0045", true, 0, "\u0065", 0, 1, true },
121                 new Object[] { "\u0046", true, 0, "\u0066", 0, 1, true },
122                 new Object[] { "\u0047", true, 0, "\u0067", 0, 1, true },
123                 new Object[] { "\u0048", true, 0, "\u0068", 0, 1, true },
124                 new Object[] { "\u0049", true, 0, "\u0069", 0, 1, true },
125                 new Object[] { "\u004a", true, 0, "\u006a", 0, 1, true },
< prev index next >