Branch Coverage

Collate.xs
Criterion Covered Total %
branch 518 652 79.4


line true false branch
112 119888 127 for (rest = (char **)UCA_rest; *rest; ++rest) {
113 0 119888 XPUSHs(sv_2mortal(newSVpv((char *) *rest, 0)));
124 16798 0 if (!OVER_UTF_MAX(uv)){
126 16798 0 if (plane) {
128 16798 0 result = row ? row[uv & 0xff] : NULL;
131 16798 0 if (result) {
135 16798 0 EXTEND(SP, num);
0 16798 EXTEND(SP, num);
136 21884 16798 for (i = 0; i < num; ++i) {
154 58109 0 if (!OVER_UTF_MAX(uv)){
156 58105 4 if (plane) {
158 33900 24205 result = row ? row[uv & 0xff] : NULL;
160 33570 24539 if (result)
164 29006 29103 if (ix)
165 16798 12208 RETVAL = boolSV(num >0);
167 54 29049 RETVAL = boolSV(num==0);
182 574242 0 s = SvPV(src,byte);
183 1981806 574242 for (e = s + byte; s < e;) {
185 514116 1467690 if (! hexdigit)
188 5539079 355631 while (*s) {
190 1112059 4427020 if (! hexdigit)
192 0 4427020 if (overflowed)
194 0 4427020 if (value > MAX_DIV_16) {
200 0 1467690 XPUSHs(sv_2mortal(newSVuv(overflowed ? UV_MAX : value)));
0 1467690 XPUSHs(sv_2mortal(newSVuv(overflowed ? UV_MAX : value)));
210 4888 0 if (!sv || !SvIOK(sv))
0 4888 if (!sv || !SvIOK(sv))
213 4847 41 RETVAL = boolSV(
4828 19 RETVAL = boolSV(
1442 3386 RETVAL = boolSV(
1431 11 RETVAL = boolSV(
969 3848 RETVAL = boolSV(
4 965 RETVAL = boolSV(
236 60 45 EXTEND(SP, tindex ? 3 : 2);
0 105 EXTEND(SP, tindex ? 3 : 2);
0 0 EXTEND(SP, tindex ? 3 : 2);
239 60 45 if (tindex)
251 434 764 if (codeRange(Hangul_SIni, Hangul_SFin)) {
111 323 if (codeRange(Hangul_SIni, Hangul_SFin)) {
252 66 45 if ((code - Hangul_SBase) % Hangul_TCount) {
257 270 817 } else if (uca_vers < 20) {
258 246 24 if (codeRange(Hangul_LIni, Hangul_LFin) || code == Hangul_LFill) {
228 18 if (codeRange(Hangul_LIni, Hangul_LFin) || code == Hangul_LFill) {
6 246 if (codeRange(Hangul_LIni, Hangul_LFin) || code == Hangul_LFill) {
260 210 36 } else if (codeRange(Hangul_VIni, Hangul_VFin)) {
24 186 } else if (codeRange(Hangul_VIni, Hangul_VFin)) {
262 174 48 } else if (codeRange(Hangul_TIni, Hangul_TFin)) {
24 150 } else if (codeRange(Hangul_TIni, Hangul_TFin)) {
268 755 62 if (codeRange(Hangul_LIni, Hangul_LEnd) ||
602 153 if (codeRange(Hangul_LIni, Hangul_LEnd) ||
286 378 if (codeRange(Hangul_LIni, Hangul_LEnd) ||
269 39 247 codeRange(HangulL2Ini, HangulL2Fin)) {
271 563 62 } else if (codeRange(Hangul_VIni, Hangul_VEnd) ||
405 158 } else if (codeRange(Hangul_VIni, Hangul_VEnd) ||
195 272 } else if (codeRange(Hangul_VIni, Hangul_VEnd) ||
272 39 156 codeRange(HangulV2Ini, HangulV2Fin)) {
274 366 62 } else if (codeRange(Hangul_TIni, Hangul_TEnd) ||
254 112 } else if (codeRange(Hangul_TIni, Hangul_TEnd) ||
130 186 } else if (codeRange(Hangul_TIni, Hangul_TEnd) ||
275 39 91 codeRange(HangulT2Ini, HangulT2Fin)) {
308 9718 3025 if (codeRange(CJK_UidIni, CJK_CompFin)) {
6123 3595 if (codeRange(CJK_UidIni, CJK_CompFin)) {
309 792 5331 if (codeRange(CJK_CompIni, CJK_CompFin))
792 0 if (codeRange(CJK_CompIni, CJK_CompFin))
312 2845 2486 basic_unified = (ix >= 11 ? (code <= CJK_UidF130) :
354 2132 basic_unified = (ix >= 11 ? (code <= CJK_UidF130) :
127 2005 basic_unified = (ix >= 11 ? (code <= CJK_UidF130) :
270 1735 basic_unified = (ix >= 11 ? (code <= CJK_UidF130) :
582 1153 basic_unified = (ix >= 11 ? (code <= CJK_UidF130) :
296 857 basic_unified = (ix >= 11 ? (code <= CJK_UidF130) :
156 701 basic_unified = (ix >= 11 ? (code <= CJK_UidF130) :
334 367 basic_unified = (ix >= 11 ? (code <= CJK_UidF130) :
322 3302 3318 if (ix >= 7) {
323 1111 28 tangut = (ix >= 11) ? (codeRange(TangIdeoIni, TangIdeo120) ||
1108 915 tangut = (ix >= 11) ? (codeRange(TangIdeoIni, TangIdeo120) ||
324 1139 912 codeRange(TangCompIni, TangComp130) ||
1096 12 codeRange(TangCompIni, TangComp130) ||
1087 924 codeRange(TangCompIni, TangComp130) ||
325 2051 1251 codeRange(TangSuppIni, TangSuppFin)) :
2 1085 codeRange(TangSuppIni, TangSuppFin)) :
496 755 codeRange(TangSuppIni, TangSuppFin)) :
248 507 codeRange(TangSuppIni, TangSuppFin)) :
326 248 248 (ix == 10) ? (codeRange(TangIdeoIni, TangIdeo120) ||
192 56 (ix == 10) ? (codeRange(TangIdeoIni, TangIdeo120) ||
186 254 (ix == 10) ? (codeRange(TangIdeoIni, TangIdeo120) ||
327 20 166 codeRange(TangCompIni, TangCompFin)) :
328 124 124 (ix == 9) ? (codeRange(TangIdeoIni, TangIdeo110) ||
99 25 (ix == 9) ? (codeRange(TangIdeoIni, TangIdeo110) ||
93 130 (ix == 9) ? (codeRange(TangIdeoIni, TangIdeo110) ||
329 10 83 codeRange(TangCompIni, TangCompFin)) :
330 259 248 (codeRange(TangIdeoIni, TangIdeoFin) ||
221 38 (codeRange(TangIdeoIni, TangIdeoFin) ||
195 274 (codeRange(TangIdeoIni, TangIdeoFin) ||
331 22 173 codeRange(TangCompIni, TangCompFin));
333 3048 3572 if (ix >= 8)
334 1376 1672 nushu = (codeRange(NushuIni, NushuFin));
69 1307 nushu = (codeRange(NushuIni, NushuFin));
335 2051 4569 if (ix >= 11)
336 1096 955 khitan = (codeRange(KhitanIni, KhitanFin));
7 1089 khitan = (codeRange(KhitanIni, KhitanFin));
338 213 12530 base = tangut
69 12461 base = tangut
7 12454 base = tangut
4230 8224 base = tangut
2044 6180 base = tangut
1486 558 base = tangut
1486 5770 base = tangut
346 1796 248 ((ix >= 11 ? codeRange(CJK_ExtAIni, CJK_ExtA130)
558 1238 ((ix >= 11 ? codeRange(CJK_ExtAIni, CJK_ExtA130)
347 4440 1740 : codeRange(CJK_ExtAIni, CJK_ExtAFin))
410 4030 : codeRange(CJK_ExtAIni, CJK_ExtAFin))
348 5770 410 ||
475 1011 ||
5683 87 ||
349 1065 421 (ix >= 11 ? codeRange(CJK_ExtBIni, CJK_ExtB130)
1011 54 (ix >= 11 ? codeRange(CJK_ExtBIni, CJK_ExtB130)
350 1063 4707 : codeRange(CJK_ExtBIni, CJK_ExtBFin))
87 976 : codeRange(CJK_ExtBIni, CJK_ExtBFin))
351 4182 1976 ||
352 632 3550 (ix >= 3 && codeRange(CJK_ExtCIni, CJK_ExtCFin))
580 52 (ix >= 3 && codeRange(CJK_ExtCIni, CJK_ExtCFin))
353 3785 2321 ||
354 487 3298 (ix >= 4 && codeRange(CJK_ExtDIni, CJK_ExtDFin))
439 48 (ix >= 4 && codeRange(CJK_ExtDIni, CJK_ExtDFin))
355 1963 4095 ||
356 207 1756 (ix >= 6 && codeRange(CJK_ExtEIni, CJK_ExtEFin))
179 28 (ix >= 6 && codeRange(CJK_ExtEIni, CJK_ExtEFin))
357 1363 4667 ||
358 107 1256 (ix >= 8 && codeRange(CJK_ExtFIni, CJK_ExtFFin))
87 20 (ix >= 8 && codeRange(CJK_ExtFIni, CJK_ExtFFin))
359 459 5551 ||
360 15 444 (ix >= 11 && codeRange(CJK_ExtGIni, CJK_ExtGFin)))
4 11 (ix >= 11 && codeRange(CJK_ExtGIni, CJK_ExtGFin)))
363 12530 213 aaaa = tangut || nushu || khitan ? base : base + (code >> 15);
12461 69 aaaa = tangut || nushu || khitan ? base : base + (code >> 15);
12454 7 aaaa = tangut || nushu || khitan ? base : base + (code >> 15);
366 213 12530 khitan ? (code - KhitanIni) : (code & 0x7FFF)) | 0x8000;
69 12461 khitan ? (code - KhitanIni) : (code & 0x7FFF)) | 0x8000;
7 12454 khitan ? (code - KhitanIni) : (code & 0x7FFF)) | 0x8000;
375 0 12743 EXTEND(SP, 2);
398 0 495 EXTEND(SP, 2);
423 13119 1188 if (CJK_UidIni <= code) {
424 2164 10955 if (codeRange(CJK_CompIni, CJK_CompFin))
576 1588 if (codeRange(CJK_CompIni, CJK_CompFin))
427 10160 2383 basic_unified = (uca_vers >= 43 ? (code <= CJK_UidF130) :
342 2041 basic_unified = (uca_vers >= 43 ? (code <= CJK_UidF130) :
114 1927 basic_unified = (uca_vers >= 43 ? (code <= CJK_UidF130) :
228 1699 basic_unified = (uca_vers >= 43 ? (code <= CJK_UidF130) :
456 1243 basic_unified = (uca_vers >= 43 ? (code <= CJK_UidF130) :
228 1015 basic_unified = (uca_vers >= 43 ? (code <= CJK_UidF130) :
114 901 basic_unified = (uca_vers >= 43 ? (code <= CJK_UidF130) :
228 673 basic_unified = (uca_vers >= 43 ? (code <= CJK_UidF130) :
437 4081 10226 RETVAL = boolSV(
3550 531 RETVAL = boolSV(
2937 613 RETVAL = boolSV(
999 2469 RETVAL = boolSV(
951 48 RETVAL = boolSV(
949 2 RETVAL = boolSV(
3051 415 RETVAL = boolSV(
1388 1663 RETVAL = boolSV(
456 932 RETVAL = boolSV(
101 2433 RETVAL = boolSV(
24 77 RETVAL = boolSV(
22 2 RETVAL = boolSV(
1305 1227 RETVAL = boolSV(
260 1045 RETVAL = boolSV(
234 26 RETVAL = boolSV(
1168 1338 RETVAL = boolSV(
192 976 RETVAL = boolSV(
168 24 RETVAL = boolSV(
611 1871 RETVAL = boolSV(
84 527 RETVAL = boolSV(
70 14 RETVAL = boolSV(
409 2059 RETVAL = boolSV(
40 369 RETVAL = boolSV(
30 10 RETVAL = boolSV(
91 2367 RETVAL = boolSV(
4 87 RETVAL = boolSV(
2 2 RETVAL = boolSV(
477 59153 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
59153 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
482 59153 0 if (SvROK(buf) && SvTYPE(SvRV(buf)) == SVt_PVAV)
59153 0 if (SvROK(buf) && SvTYPE(SvRV(buf)) == SVt_PVAV)
489 2241 56912 if (buf_len < 0) { /* empty: -1 */
494 13446 2241 while (dlen--)
498 56912 0 level = svp ? SvIV(*svp) : MaxLevel;
56912 0 level = svp ? SvIV(*svp) : MaxLevel;
500 161407 56912 for (lv = 0; lv < level; lv++) {
506 2430 54482 upper_lower = svp ? SvTRUE(*svp) : FALSE;
2430 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 2430 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 2430 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 2430 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
2430 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
2430 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
575 1855 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 575 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
1855 575 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
508 453 56459 kata_hira = svp ? SvTRUE(*svp) : FALSE;
453 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 453 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 453 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 453 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
453 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
453 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
217 236 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 217 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
236 217 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
510 56912 0 uca_vers = SvIV(*svp);
512 56305 0 v2i = uca_vers >= 9 && svp /* (vers >= 9) and not (non-ignorable) */
513 59 2493 ? !(SvCUR(*svp) == 13 && memEQ(SvPVX(*svp), "non-ignorable", 13))
514 56305 607 : FALSE;
2552 53753 : FALSE;
517 100599 56912 for (i = 0; i <= buf_len; i++) {
520 100599 0 if (svp && SvPOK(*svp))
100599 0 if (svp && SvPOK(*svp))
521 100599 0 v = (U8*)SvPV(*svp, vlen);
525 0 100599 if (vlen < VCE_Length) /* ignore short VCE (unexpected) */
529 93608 6991 if (v2i) {
530 1777 91831 if (*v)
532 7511 84320 else if (v[1] || v[2]) /* non zero primary weight */
212 7299 else if (v[1] || v[2]) /* non zero primary weight */
534 43 7256 else if (last_is_var) /* zero primary weight; skipped */
538 100556 0 if (v[5] == 0) { /* tert wt < 256 */
539 4279 96277 if (upper_lower) {
540 832 3447 if (0x8 <= v[6] && v[6] <= 0xC) /* lower */
571 261 if (0x8 <= v[6] && v[6] <= 0xC) /* lower */
542 2635 1073 else if (0x2 <= v[6] && v[6] <= 0x6) /* upper */
2102 533 else if (0x2 <= v[6] && v[6] <= 0x6) /* upper */
544 57 1549 else if (v[6] == 0x1C) /* square upper */
546 61 1488 else if (v[6] == 0x1D) /* square lower */
549 378 100178 if (kata_hira) {
550 202 176 if (0x0F <= v[6] && v[6] <= 0x13) /* katakana */
202 0 if (0x0F <= v[6] && v[6] <= 0x13) /* katakana */
552 30 146 else if (0xD <= v[6] && v[6] <= 0xE) /* hiragana */
30 0 else if (0xD <= v[6] && v[6] <= 0xE) /* hiragana */
557 293617 100556 for (lv = 0; lv < level; lv++) {
558 182863 110754 if (v[2 * lv + 1] || v[2 * lv + 2]) {
131159 51704 if (v[2 * lv + 1] || v[2 * lv + 2]) {
566 161407 56912 for (lv = 0; lv < level; lv++)
574 56912 0 back_flag = svp ? SvUV(*svp) : (UV)0;
0 56912 back_flag = svp ? SvUV(*svp) : (UV)0;
576 161407 56912 for (lv = 0; lv < level; lv++) {
577 381 161026 if (back_flag & (1 << (lv + 1))) {
580 2139 381 for ( ; e < p; p -= 2) {
588 479548 161026 while (p < e)
591 149270 12137 if (lv + 1 < MaxLevel) { /* lv + 1 == real level */
597 66241 56912 for (lv = level; lv < MaxLevel; lv++) {
598 21466 44775 if (lv + 1 < MaxLevel) { /* lv + 1 == real level */
604 161407 56912 for (lv = 0; lv < level; lv++) {
628 102824 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
102824 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
634 897 101927 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
897 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 897 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 897 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 897 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
897 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
897 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
402 495 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 402 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
495 402 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
637 102824 0 vbl = svp ? *svp : &PL_sv_no;
638 102824 0 a = (U8*)SvPV(vbl, alen);
639 102824 0 v = (U8*)SvPV(vce, vlen);
649 495 102329 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
21 474 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
21 0 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
19 2 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
19 0 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
656 102824 0 if (vlen >= VCE_Length && *a != 'n') {
97080 5744 if (vlen >= VCE_Length && *a != 'n') {
657 2124 94956 if (*v) {
658 2064 60 if (*a == 's') { /* shifted or shift-trimmed */
663 94736 220 } else if (*a == 's') { /* shifted or shift-trimmed */
665 94538 198 if (alen == 7 && totwt != 0) { /* shifted */
94517 21 if (alen == 7 && totwt != 0) { /* shifted */
666 7654 86863 if (d[1] == 0 && d[2] == 1) { /* XXX: CollationAuxiliary-6.2.0 */
66 7588 if (d[1] == 0 && d[2] == 1) { /* XXX: CollationAuxiliary-6.2.0 */
671 0 94451 if (!svp)
673 94451 0 uca_vers = SvIV(*svp);
676 78164 16287 if (uca_vers >= 36 && d[3] + d[4] + d[5] + d[6] == 0) {
11629 66535 if (uca_vers >= 36 && d[3] + d[4] + d[5] + d[6] == 0) {
707 258 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
258 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
713 0 258 if (!svp)
715 258 0 uca_vers = SvIV(*svp);
717 258 0 s = (U8*)SvPV(key, klen);
732 2450 258
734 874 1576 for (e = s + klen; s < e; s += 2) {
25 849 for (e = s + klen; s < e; s += 2) {
735 1362 239 uv = (U16)(*s << 8 | s[1]);
115 1247 uv = (U16)(*s << 8 | s[1]);
51 64 uv = (U16)(*s << 8 | s[1]);
742 765 84 *d++ = upperhex[ s[1] & 0xF ];
749 16 *d++ = upperhex[ s[1] & 0xF ];