Branch Coverage

Lua.xs
Criterion Covered Total %
branch 106 138 76.8


line true false branch
72 2 0 if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)
2 0 if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)
0 2 if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)
80 56 0 for (level--; level>=0; level--)
81 55 1 if (ms->capture[level].len == CAP_UNFINISHED) return level;
89 0 14 if (p == ms->p_end)
94 13 18 if (*p == '^') p++;
96 1 80 if (p == ms->p_end)
98 3 77 if (*(p++) == L_ESC && p < ms->p_end)
3 0 if (*(p++) == L_ESC && p < ms->p_end)
100 50 30 } while (*p != ']');
126 1 14 return (islower(cl) ? res : !res);
132 19 23 if (*(p+1) == '^') {
136 57 22 while (++p < ec) {
137 3 54 if (*p == L_ESC) {
139 1 2 if (match_class(c, uchar(*p)))
142 21 33 else if ((*(p+1) == '-') && (p+2 < ec)) {
21 0 else if ((*(p+1) == '-') && (p+2 < ec)) {
144 18 3 if (uchar(*(p-2)) <= c && c <= uchar(*p))
8 10 if (uchar(*(p-2)) <= c && c <= uchar(*p))
147 11 22 else if (uchar(*p) == c) return sig;
155 19 213 if (s >= ms->src_end)
171 1 1 if (p >= ms->p_end - 1)
173 0 1 if (*s != *p) return NULL;
178 5 0 while (++s < ms->src_end) {
179 1 4 if (*s == e) {
180 1 0 if (--cont == 0) return s+1;
182 0 4 else if (*s == b) cont++;
192 11 5 while (singlematch(ms, s + i, p, ep))
195 5 0 while (i>=0) {
197 5 0 if (res) return res;
208 0 0 if (res != NULL)
210 0 0 else if (singlematch(ms, s, p, ep))
221 0 69 if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures");
225 29 40 if ((res=match(ms, s, p)) == NULL) /* match failed? */
236 17 38 if ((res = match(ms, s, p)) == NULL) /* match failed? */
246 2 0 if ((size_t)(ms->src_end-s) >= len &&
247 1 1 memcmp(ms->capture[l].init, s, len) == 0)
254 281 0 if (ms->matchdepth-- == 0)
257 357 65 if (p != ms->p_end) { /* end of pattern? */
260 1 68 if (*(p + 1) == ')') /* position capture? */
271 0 0 if ((p + 1) != ms->p_end) /* is the '$' the last char in pattern? */
273 0 0 s = (s == ms->src_end) ? s : NULL; /* check end of string */
280 1 0 if (s != NULL) {
288 0 12 if (*p != '[')
291 10 2 previous = (s == ms->src_init) ? '\0' : *(s - 1);
303 1 1 if (s != NULL) {
315 76 140 if (!singlematch(ms, s, p, ep)) {
316 74 2 if (*ep == '*' || *ep == '?' || *ep == '-') { /* accept empty? */
73 1 if (*ep == '*' || *ep == '?' || *ep == '-') { /* accept empty? */
0 73 if (*ep == '*' || *ep == '?' || *ep == '-') { /* accept empty? */
326 1 0 if ((res = match(ms, s + 1, ep + 1)) != NULL)
394 1 60 if (flags & ~(RXf_SPLIT)) {
406 1 60 if (flags & RXf_SPLIT && plen == 1 && exp[0] == ' ')
1 0 if (flags & RXf_SPLIT && plen == 1 && exp[0] == ' ')
1 0 if (flags & RXf_SPLIT && plen == 1 && exp[0] == ' ')
410 1 60 if (plen == 0)
414 14 46 else if (plen == 1 && exp[0] == '^')
0 14 else if (plen == 1 && exp[0] == '^')
418 9 51 else if (plen == 3 && strnEQ("%s+", exp, 3))
1 8 else if (plen == 3 && strnEQ("%s+", exp, 3))
478 1 83 if (anchor) {
496 65 84 if (res != NULL) {
512 40 64 for (i = 0; i < ms.level; i++) {
514 1 39 if (l == CAP_UNFINISHED)
516 1 38 if (l == CAP_POSITION)
529 68 16 } while (s1++ < ms.src_end && !anchor);
67 1 } while (s1++ < ms.src_end && !anchor);
605 0 19 XPUSHs(sv_2mortal(newSViv(PTR2IV(&lua_engine))));