Branch Coverage

lib/Data/Pond.xs
Criterion Covered Total %
branch 268 366 73.2


line true false branch
100 38 401 if(!(val & 0x80)) return val;
101 0 38 if(!(val & 0x40)) throw_utf8_error();
102 38 0 if(!(val & 0x20)) {
103 0 38 if(!(val & 0x1e)) throw_utf8_error();
107 0 0 } else if(!(val & 0x10)) {
111 0 0 } else if(!(val & 0x08)) {
115 0 0 } else if(!(val & 0x04)) {
119 0 0 } else if(!(val & 0x02)) {
123 0 0 } else if(!(val & 0x01)) {
124 0 0 if(!(p[1] & 0x3e)) throw_utf8_error();
125 0 0 for(i = 6; i--; )
126 0 0 if((*++p & 0xc0) != 0x80)
131 0 0 for(i = 6; i--; ) {
133 0 0 if((ext & 0xc0) != 0x80)
137 0 0 if(!(first_six & 0x3f))
139 0 0 for(i = 6; i--; )
140 0 0 if((*++p & 0xc0) != 0x80)
144 38 0 if(val == 0 && !(p[1] & req_c1))
0 0 if(val == 0 && !(p[1] & req_c1))
146 38 38 for(i = ncont; i--; ) {
148 0 38 if((ext & 0xc0) != 0x80)
161 33 0 vstart = (U8*)SvGROW(str, vlen+6+1);
0 33 vstart = (U8*)SvGROW(str, vlen+6+1);
173 158 250 if(SvUTF8(input)) return input;
175 244 1820 for(end = p + len; p != end; p++) {
176 6 1814 if(*p & 0x80) {
219 7 218 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_WSP);
6 197 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_WSP);
285 228 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_WSP);
33 160 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_WSP);
20 47 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_WSP);
224 396 2 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_DQSPECIAL);
195 201 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_DQSPECIAL);
376 9 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_DQSPECIAL);
181 195 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_DQSPECIAL);
229 29 2 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_CONTROL);
25 4 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_CONTROL);
400 2 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_CONTROL);
396 4 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_CONTROL);
234 3 25 return (c >= 0x80) ? c <= 0xa0 : (asciichar_attr[c] & CHARATTR_CONTROL);
11 376 return (c >= 0x80) ? c <= 0xa0 : (asciichar_attr[c] & CHARATTR_CONTROL);
0 0 return (c >= 0x80) ? c <= 0xa0 : (asciichar_attr[c] & CHARATTR_CONTROL);
239 8 42 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_WORDSTART);
244 0 0 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_WORDCONT);
47 8 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_WORDCONT);
249 84 60 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_DECDIGIT);
0 5 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_DECDIGIT);
34 59 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_DECDIGIT);
254 2 1 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_OCTDIGIT);
1 1 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_OCTDIGIT);
259 9 21 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_HEXDIGIT);
21 0 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_HEXDIGIT);
0 9 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_HEXDIGIT);
9 16 return !(c & 0x80) && (asciichar_attr[c] & CHARATTR_HEXDIGIT);
264 0 6 return c <= '9' ? c - '0' : c <= 'F' ? c - 'A' + 10 : c - 'a' + 10;
0 5 return c <= '9' ? c - '0' : c <= 'F' ? c - 'A' + 10 : c - 'a' + 10;
0 2 return c <= '9' ? c - '0' : c <= 'F' ? c - 'A' + 10 : c - 'a' + 10;
269 225 0 while(char_is_wsp(*p))
203 0 while(char_is_wsp(*p))
513 0 while(char_is_wsp(*p))
193 0 while(char_is_wsp(*p))
67 0 while(char_is_wsp(*p))
301 402 0 if(p == end || char_is_control(c)) throw_syntax_error(p);
306 2 385 if(unichar_is_control(val))
310 385 0 } while(q != end && !char_is_dqspecial(c));
190 195 } while(q != end && !char_is_dqspecial(c));
315 60 141 if(c == '"') break;
316 0 60 if(c != '\\') throw_syntax_error(p);
318 0 60 if(p == end) throw_syntax_error(p);
319 0 60 if(c & 0x80) {
321 0 0 if(unichar_is_control(val)) throw_syntax_error(q);
326 3 57 if(e == 0xff) {
328 3 0 c = *++p;
332 2 0 c = *p;
339 30 27 } else if(e == 0xfe) {
341 30 0 c = *++p;
343 15 6 p++;
345 21 0 c = *p;
348 16 5 val = (val << 4) | hexdigit_value(c);
350 9 0 } else if(c == '{') {
352 9 0 c = *p;
357 0 25 if(val & 0x78000000)
360 23 2 val = (val << 4) | hexdigit_value(c);
361 25 0 c = *++p;
362 16 9 } while(char_is_hexdigit(c));
363 0 9 if(c != '}') throw_syntax_error(p);
369 1 26 } else if(e == 0xfd) {
388 31 0 if(p == end || char_is_control(c)) throw_syntax_error(p);
389 18 9 if(c == '\'') break;
390 14 4 if(c != '\\') {
394 2 26 if(unichar_is_control(val))
398 18 8 } while(q != end && c != '\'' && c != '\\');
14 4 } while(q != end && c != '\'' && c != '\\');
403 2 2 if(c == '\\' || c == '\'')
420 0 45 if(!(alen & 1))
425 58 45 for(i = 0; i <= alen; i += 2) {
430 58 0 if(!key_ptr || !sv_is_string(*key_ptr))
58 0 if(!key_ptr || !sv_is_string(*key_ptr))
0 58 if(!key_ptr || !sv_is_string(*key_ptr))
433 58 0 value = *av_fetch(array, i+1, 0);
434 0 58 if(!hv_store(hash, key_str, -key_len, SvREFCNT_inc(value), 0))
447 148 234 if(c == '"') {
450 15 219 } else if(c == '\'') {
453 102 117 } else if(c == '[' || c == '{') {
455 57 45 U8 close = is_hash ? '}' : ']';
461 164 64 if(*p == close) break;
464 126 34 if(*p == close) break;
465 70 56 if(*p == ',') {
467 56 0 } else if(p[0] == '=' && p[1] == '>') {
56 0 } else if(p[0] == '=' && p[1] == '>') {
474 45 53 datum = is_hash ? array_to_hash(array) :
476 0 117 } else if(c & 0x80) {
480 47 70 if(attr & CHARATTR_WORDSTART) {
483 0 55 while(char_is_wordcont(*p))
486 45 2 if(!(q[0] == '=' && q[1] == '>'))
0 45 if(!(q[0] == '=' && q[1] == '>'))
489 64 6 } else if(attr & CHARATTR_DECDIGIT) {
491 5 59 if(c == '0') {
492 5 0 if(char_is_decdigit(*p)) throw_syntax_error(p);
494 93 0 while(char_is_decdigit(*p))
518 12 140 if(len == 0 || len > 9) return 0;
519 20 120 if(*p == '0') return len == 1;
520 144 36 for(; p != e; p++) {
521 0 144 if(!char_is_decdigit(*p)) return 0;
558 40 112 if(pvn_is_integer(p, len)) {
564 360 112 while(p != e) {
566 24 336 if(c & 0x80) {
568 0 24 if(val == 0x80000000)
570 16 8 if(val <= 0xa0 || !wo->unicode) {
8 8 if(val <= 0xa0 || !wo->unicode) {
571 16 0 if(lstart != p)
577 8 16 if(val <= 0xa0) {
582 8 8 if(!wo->unicode) {
592 308 28 if(quote == ASCIICHAR_QUOTE_LITERAL) {
596 28 0 if(lstart != p)
599 8 20 if(quote == ASCIICHAR_QUOTE_HEXPAIR) {
616 108 4 if(lstart != p) sv_catpvn_nomg(out, (char*)lstart, p-lstart);
624 50 0 if(!char_is_wordstart(*p)) return 0;
625 4 38 while(++p != e) {
626 0 4 if(!char_is_wordcont(*p)) return 0;
4 0 if(!char_is_wordcont(*p)) return 0;
639 38 12 if(pvn_is_bareword(p, len)) {
650 64 71 if(indent != -1) {
652 64 0 char *p = SvGROW(out, cur+indent+2) + cur;
0 64 char *p = SvGROW(out, cur+indent+2) + cur;
671 20 23 if(alen == -1) {
676 10 13 if(wo->indent != -1) wo->indent += 4;
681 21 8 if(pos == alen && wo->indent == -1)
10 11 if(pos == alen && wo->indent == -1)
684 8 10 if(pos == alen)
688 10 11 if(wo->indent != -1) wo->indent -= 4;
700 4 34 if(nelem == 0) {
707 50 34 for(pos = nelem; pos--; ) {
714 16 18 if(wo->indent != -1) wo->indent += 4;
721 26 24 if(wo->indent == -1) {
728 33 16 if(pos == nelem-1 && wo->indent == -1)
16 17 if(pos == nelem-1 && wo->indent == -1)
731 16 16 if(pos == nelem-1)
735 16 17 if(wo->indent != -1) wo->indent -= 4;
743 234 1 if(sv_is_undef(datum) && wo->undef_is_empty) {
6 228 if(sv_is_undef(datum) && wo->undef_is_empty) {
3 3 if(sv_is_undef(datum) && wo->undef_is_empty) {
745 231 1 } else if(sv_is_string(datum)) {
140 91 } else if(sv_is_string(datum)) {
749 4 88 if(!SvROK(datum))
752 4 84 if(SvOBJECT(datum))
754 43 41 if(SvTYPE(datum) == SVt_PVAV) {
756 38 3 } else if(SvTYPE(datum) == SVt_PVHV) {
775 228 1 if(!sv_is_string(text_sv)) throw_data_error("text isn't a string");
10 218 if(!sv_is_string(text_sv)) throw_data_error("text isn't a string");
782 2 195 if(p != end) throw_syntax_error(p);
791 154 0 struct writer_options wo = { -1, 0, 0 };
793 154 0 if(options) {
796 0 154 if(!SvROK(options))
799 0 154 if(SvOBJECT(options) || SvTYPE(options) != SVt_PVHV)
802 70 84 if((item_ptr = hv_fetchs(opthash, "indent", 0))) {
804 70 0 if(!sv_is_undef(item)) {
70 0 if(!sv_is_undef(item)) {
805 70 0 if(!sv_is_string(item))
0 70 if(!sv_is_string(item))
809 0 70 if(wo.indent < 0)
814 3 151 if((item_ptr = hv_fetchs(opthash, "undef_is_empty", 0))) {
818 70 84 if((item_ptr = hv_fetchs(opthash, "unicode", 0))) {