Branch Coverage

SL.xs
Criterion Covered Total %
branch 328 508 64.5


line true false branch
41 0 6 kbuf = HePV(he, klen);
0 0 kbuf = HePV(he, klen);
42 0 6 is_utf8 = HeUTF8(he);
152 12 3 if (nbuf == 1) {
153 0 12 PLJSONSL_NEWSVUV_fast(newsv, state->nelem);
156 0 3 if (*buf == '0') { die_numeric("leading zero for non-fraction"); }
157 3 0 if (nbuf < (UV_DIG-1)) {
158 0 3 PLJSONSL_NEWSVUV_fast(newsv, state->nelem);
166 0 1 if (nbuf == 0) { die_numeric("found lone '-'"); }
167 1 0 if (nbuf > 1 && buf[1] == '0') {
0 1 if (nbuf > 1 && buf[1] == '0') {
170 1 0 if (nbuf < (IV_DIG-1)) {
178 12 0 if (state->special_flags & JSONSL_SPECIALf_NUMNOINT) {
252 0 30 if (newsv == NULL) {
284 16 9 if (state->nescapes == 0) {
297 0 9 if (!newlen) {
303 0 9 if (flags & JSONSL_SPECIALf_NONASCII) {
309 1 24 if (pjsn->options.utf8) {
334 1155 5 if (pjsn->options.object_drip == 0 &&
8 1147 if (pjsn->options.object_drip == 0 &&
335 0 8 (child->matchres != JSONSL_MATCH_COMPLETE || child->type == JSONSL_T_HKEY)) {
340 9 4 if (SvTYPE(child->sv) == SVt_PVHV || SvTYPE(child->sv) == SVt_PVAV) {
2 7 if (SvTYPE(child->sv) == SVt_PVHV || SvTYPE(child->sv) == SVt_PVAV) {
346 12 1 if (pjsn->options.noqstr == 0 && pjsn->options.object_drip == 0) {
7 5 if (pjsn->options.noqstr == 0 && pjsn->options.object_drip == 0) {
351 12 1 if (pjsn->options.nopath == 0) {
355 21 12 for (ii = 2; ii <= (child->level); ii++) {
358 13 8 if (prev->type == JSONSL_T_LIST) {
364 0 8 kbuf = HePV(cur->u_loc.key, klen);
0 0 kbuf = HePV(cur->u_loc.key, klen);
367 0 8 if (HeKUTF8(cur->u_loc.key)) {
373 12 0 if (SvCUR(pathstr) != 1) {
384 13 0 if (parent && parent->sv) {
13 0 if (parent && parent->sv) {
387 7 6 if (parent->type == JSONSL_T_LIST) {
389 7 0 if (popped_sv) {
444 2137 1082 if (parent->type == JSONSL_T_OBJECT) {
445 1071 1066 if (state->type == JSONSL_T_HKEY) {
463 12 2136 if (parent->matchres == JSONSL_MATCH_POSSIBLE) {
474 1118 1030 if (!JSONSL_STATE_IS_CONTAINER(state)) {
61 1057 if (!JSONSL_STATE_IS_CONTAINER(state)) {
478 1030 1057 if (state->type == JSONSL_T_OBJECT) {
480 1057 0 } else if (state->type == JSONSL_T_LIST) {
487 1059 1028 if (parent->type == JSONSL_T_LIST) {
519 2 1069 if (state->nescapes) {
540 1068 1 pjsn->curhk = storeget_he(pjsn, parent->sv, buf, len, &PL_sv_undef,
0 1068 pjsn->curhk = storeget_he(pjsn, parent->sv, buf, len, &PL_sv_undef,
591 23 2208 if (state->type == JSONSL_T_STRING) {
593 23 0 INSERT_STRING;
18 5 INSERT_STRING;
14 4 INSERT_STRING;
594 1071 1137 } else if (state->type == JSONSL_T_HKEY) {
597 30 1107 } else if (state->type == JSONSL_T_SPECIAL) {
600 30 0 INSERT_STRING;
28 2 INSERT_STRING;
11 17 INSERT_STRING;
608 43 2188 if (state->sv == pjsn->root) {
609 38 5 if (pjsn->njprs == 0 && pjsn->options.object_drip == 0) {
38 0 if (pjsn->njprs == 0 && pjsn->options.object_drip == 0) {
640 0 4 if (!pjsn->options.root_callback) {
646 0 4 PUSHMARK(SP);
647 0 4 XPUSHs(sv_2mortal(newRV_inc(pjsn->root)));
650 4 0 FREETMPS;
663 26 34 if (state->type == JSONSL_T_LIST) {
665 34 0 } else if (state->type == JSONSL_T_OBJECT) {
671 4 56 if (pjsn->options.root_callback) {
697 0 24 if (!SvPOK(input)) {
701 2 22 CHECK_MAX_SIZE(pjsn, input)
1 1 CHECK_MAX_SIZE(pjsn, input)
704 1 22 if (SvUTF8(input)) {
721 11 0 if (pjsn->keep_pos == 0) {
723 0 0 } else if (pjsn->keep_pos > start_pos) {
733 7 25 if (MY_CXT.quick == NULL) {
754 0 32 if (!SvPOK(input)) {
758 0 32 if (SvUTF8(input)) {
761 0 32 CHECK_MAX_SIZE(pjsn, input);
0 0 CHECK_MAX_SIZE(pjsn, input);
786 0 4 if (!max) {
790 0 4 Newxz(jprs, max, jsonsl_jpr_t);
792 4 4 for (ii = 0; ii < max; ii++) {
794 4 0 if (tmpsv == NULL || SvPOK(*tmpsv) == 0) {
0 4 if (tmpsv == NULL || SvPOK(*tmpsv) == 0) {
799 0 4 if (jprs[ii] == NULL) {
811 0 0 for (ii = 0; ii < max; ii++) {
812 0 0 if (jprs[ii] == NULL) {
818 0 0 if (pathstr) {
853 0 57 if (tuba->options.cb_unified) {
862 57 0 if (gvpp) {
865 57 0 if (namep) {
877 0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
1 3 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
0 4 PLTUBA_XMETHGV
887 46 12 if (state->type != JSONSL_T_SPECIAL) {
890 4 8 if (state->special_flags & JSONSL_SPECIALf_BOOLEAN) {
892 6 2 } else if (state->special_flags & (JSONSL_SPECIALf_NUMERIC | JSONSL_SPECIALf_DASH)) {
894 2 0 } else if (state->special_flags == JSONSL_SPECIALf_NULL) {
928 14 12 if (tuba->accum && action == JSONSL_ACTION_POP) {
14 0 if (tuba->accum && action == JSONSL_ACTION_POP) {
938 0 26 if (meth_name == NULL) {
942 12 14 if (!mextrasv) {
950 2 24 if (tuba->last_stash != SvSTASH(SvRV(tuba->selfrv))) {
956 32 20 if (*methp == NULL) {
958 1 31 if (meth && GvCV(meth)) {
1 0 if (meth && GvCV(meth)) {
959 1 0 if (tuba->options.no_cache_mro == 0) {
973 26 5 } while (stop_mro < 2);
984 21 5 if (meth && GvCV(meth)) {
21 0 if (meth && GvCV(meth)) {
985 0 21 PUSHMARK(SP);
986 0 21 EXTEND(SP, 2);
989 12 9 if (mextrasv != &PL_sv_undef) {
990 0 12 XPUSHs(mextrasv);
995 0 5 if (!tuba->options.allow_unhandled) {
1000 0 26 FREETMPS; LEAVE;
1017 0 25 if (!tuba->keep_pos) {
1022 0 25 if (toFlush == 0) {
1027 19 6 if (tuba->shift_quote) {
1035 0 25 if (toFlush == 0 && tuba->shift_quote == 0) {
0 0 if (toFlush == 0 && tuba->shift_quote == 0) {
1044 25 0 if (tuba->accum) {
1072 2 27 if (state->level == 1) {
1076 5 22 if (parent->type == JSONSL_T_LIST) {
1083 25 4 if (tuba->accum_options[cbt & 0x7f]) {
1088 2 2 if (JSONSL_STATE_IS_CONTAINER(state) && tuba->kaccum) {
2 0 if (JSONSL_STATE_IS_CONTAINER(state) && tuba->kaccum) {
2 2 if (JSONSL_STATE_IS_CONTAINER(state) && tuba->kaccum) {
1100 27 2 if (!JSONSL_STATE_IS_CONTAINER(state)) {
25 2 if (!JSONSL_STATE_IS_CONTAINER(state)) {
1102 19 6 if (state->type & JSONSL_Tf_STRINGY) {
1125 6 19 if (state->type == JSONSL_T_SPECIAL) {
1128 3 3 if ( (state->special_flags & JSONSL_SPECIALf_NUMERIC) &&
2 1 if ( (state->special_flags & JSONSL_SPECIALf_NUMERIC) &&
1132 2 3 } else if (state->special_flags & JSONSL_SPECIALf_NUMNOINT) {
1136 2 1 } else if (state->special_flags & JSONSL_SPECIALf_BOOLEAN) {
1147 0 19 if (tuba->options.utf8) {
1150 2 17 if (state->nescapes) {
1161 0 2 if (newlen == 0) {
1165 0 2 if (flags & JSONSL_SPECIALf_NONASCII) {
1183 27 2 if (!JSONSL_STATE_IS_CONTAINER(state)) {
25 2 if (!JSONSL_STATE_IS_CONTAINER(state)) {
1188 25 0 if (tuba->accum) {
1191 0 0 if (state->nescapes) {
1196 11 14 if (state->type == JSONSL_T_HKEY &&
11 0 if (state->type == JSONSL_T_HKEY &&
1211 9 9 if (tuba->kaccum && state->type != JSONSL_T_HKEY) {
9 0 if (tuba->kaccum && state->type != JSONSL_T_HKEY) {
1226 2 16 if (state->level == 1) {
1250 0 2 if (!SvPOK(input)) {
1258 0 2 if (tuba->keep_pos) {
1408 3 21 if (items > 1) {
1409 0 3 if (!SvIOK(ST(1))) {
1412 3 0 levels = SvIV(ST(1));
1413 0 3 if (levels < 2) {
1446 3 0 if (pjsn->root) {
1459 0 3 if (!SvROK(ref)) {
1462 0 3 if (ix == 0) {
1464 1 2 } else if (ix == 1) {
1466 2 0 } else if (ix == 2) {
1473 0 5 if (!SvROK(ref)) {
1489 11 0 RETURN_RESULTS(pjsn);
0 5 RETURN_RESULTS(pjsn);
0 5 RETURN_RESULTS(pjsn);
0 3 RETURN_RESULTS(pjsn);
3 0 RETURN_RESULTS(pjsn);
0 3 RETURN_RESULTS(pjsn);
9 3 RETURN_RESULTS(pjsn);
1497 2 0 RETURN_RESULTS(pjsn);
0 1 RETURN_RESULTS(pjsn);
0 1 RETURN_RESULTS(pjsn);
0 1 RETURN_RESULTS(pjsn);
1 0 RETURN_RESULTS(pjsn);
0 1 RETURN_RESULTS(pjsn);
3 1 RETURN_RESULTS(pjsn);
1503 0 2 if (chrc > 0x7f) {
1508 2 0 if (items == 3) {
1509 2 0 pjsn->escape_table[chrc] = SvIV(ST(2));
1517 0 2 REFDEC_FIELD(pjsn, root);
1519 2 0 if (pjsn->results) {
1522 2 0 if (pjsn->buf) {
1536 1 3 if (RETVAL) {
1542 1 3 if (SvTYPE(callback) == SVt_NULL) {
1543 1 0 if (pjsn->options.root_callback) {
1548 2 1 if (SvTYPE(callback) != SVt_RV ||
0 2 if (SvTYPE(callback) != SVt_RV ||
1552 0 2 if (pjsn->options.root_callback) {
1566 24 0 if (pjsn->priv_global.is_global == 0) {
1567 14 10 REFDEC_FIELD(pjsn, root);
1568 24 0 REFDEC_FIELD(pjsn, results);
1569 24 0 REFDEC_FIELD(pjsn, buf);
1570 1 23 REFDEC_FIELD(pjsn, options.root_callback);
1573 4 20 if (pjsn->jprs) {
1574 4 4 for ( ii = 0; ii < pjsn->njprs; ii++) {
1575 0 4 if (pjsn->jprs[ii] == NULL) {
1583 24 0 if (pjsn->jsn) {
1605 29 1 RETURN_RESULTS(pjsn);
0 29 RETURN_RESULTS(pjsn);
0 29 RETURN_RESULTS(pjsn);
0 0 RETURN_RESULTS(pjsn);
0 0 RETURN_RESULTS(pjsn);
0 0 RETURN_RESULTS(pjsn);
0 0 RETURN_RESULTS(pjsn);
1606 1 29 if (result_count == 0 && av_len(pjsn->results) == -1) {
1 0 if (result_count == 0 && av_len(pjsn->results) == -1) {
1620 0 3 if (!SvPOK(input)) {
1624 3 0 if (origlen) {
1629 1 2 if (newlen == 0) {
1640 2 0 if (SvUTF8(input) || (flags & JSONSL_SPECIALf_NONASCII)) {
1 1 if (SvUTF8(input) || (flags & JSONSL_SPECIALf_NONASCII)) {
1673 0 2 REFDEC_FIELD(tuba, accum);
1674 0 2 REFDEC_FIELD(tuba, kaccum);
1675 2 0 REFDEC_FIELD(tuba, selfrv);
1679 0 2 PLTUBA_XPARAMS;
0 2 PLTUBA_XPARAMS;
2 0 PLTUBA_XPARAMS;
2 0 PLTUBA_XPARAMS;
0 2 PLTUBA_XPARAMS;
2 0 PLTUBA_XPARAMS;
1681 2 0 REFDEC_FIELD(tuba, paramhvrv);
1693 15 5 if (items > 2) {
1694 15 0 tuba->accum_options[mode & 0xff] = SvIV(ST(2));
1701 0 4 if (items > 2) {
1705 3 1 if (items == 2) {
1706 3 0 int newval = SvIV(ST(1));
1707 3 0 if (newval) {