Branch Coverage

lib/Net/IDN/Punycode.xs
Criterion Covered Total %
branch 75 94 79.7


line true false branch
47 10829 8395 delta /= first ? DAMP : 2;
1628 1735 delta /= first ? DAMP : 2;
50 17151 19224 for(k=0; delta > ((BASE-TMIN) * TMAX)/2; k += BASE)
1297 3363 for(k=0; delta > ((BASE-TMIN) * TMAX)/2; k += BASE)
61 22 124518 if(*current + add <= *end)
65 22 0 *start = SvGROW(sv, (len + add + 15) & ~15);
22 0 *start = SvGROW(sv, (len + add + 15) & ~15);
87 1734 1 in_s = in_p = SvPVutf8(input, len);
91 1712 23 if(length_guess < 64) length_guess = 64; /* optimise for maximum length of domain names */
96 1735 0 re_s = re_p = SvPV_nolen(RETVAL);
101 16330 1735 while(in_p < in_e) {
102 7282 9048 if( isBASE(*in_p) ) {
111 455 1280 if(h) {
121 31390 4993 for(in_p = skip_p = in_s; in_p < in_e;) {
122 0 31390 c = utf8_to_uvchr_buf((U8*)in_p, (U8*)in_e, &u8);
125 4254 27136 if(c >= n && c < m) {
130 24390 7000 if(c < n)
134 3258 1735 if(m == UV_MAX)
145 13433 3258 for(in_p = skip_p; in_p < in_e;) {
146 0 13433 c = utf8_to_uvchr_buf((U8*)in_p, (U8*)in_e, &u8);
149 7904 5529 if(c < n) {
151 3363 2166 } else if( c == n ) {
155 6383 3773 t = TMIN_MAX(k - bias);
156 6793 3363 if(q < t) break;
161 0 3363 if(q > BASE) croak("input exceeds punycode limit");
196 22 8379 in_s = in_p = SvPV_nolen(input);
200 8401 0 if(length_guess < 256) length_guess = 256;
204 8401 0 re_s = re_p = SvPV_nolen(RETVAL);
208 77293 8401 for(in_p = in_s; in_p < in_e; in_p++) {
210 0 77293 if(!isBASE(c)) croak("non-base character in input for decode_punycode");
211 3096 74197 if(c == DELIM) skip_p = in_p;
216 2061 6340 if(skip_p) {
226 19230 8395 for(in_p = skip_p; in_p < in_e; i++) {
231 6 70471 if(!(in_p < in_e)) croak("incomplete encoded code point in decode_punycode");
233 0 70471 if(dc < 0) croak("invalid digit in input for decode_punycode");
236 48002 22469 t = TMIN_MAX(k - bias);
237 51247 19224 if(c < t) break;
246 19224 0 u8 = UNISKIP(n); /* how many bytes we need */
15103 4121 u8 = UNISKIP(n); /* how many bytes we need */
5953 9150 u8 = UNISKIP(n); /* how many bytes we need */
0 5953 u8 = UNISKIP(n); /* how many bytes we need */
0 0 u8 = UNISKIP(n); /* how many bytes we need */
0 0 u8 = UNISKIP(n); /* how many bytes we need */
0 0 u8 = UNISKIP(n); /* how many bytes we need */
249 17188 19224 for(skip_p = re_s; j > 0; j--) /* find position in UTF-8 */
253 7777 11447 if(skip_p < re_p) /* move succeeding chars */
259 8395 0 if(!first) SvUTF8_on(RETVAL); /* UTF-8 chars have been inserted */