Branch Coverage

include/eshu_pl.h
Criterion Covered Total %
branch 282 358 78.7


line true false branch
76 22 8 return c == '(' || c == '{' || c == '[' || c == '<';
7 15 return c == '(' || c == '{' || c == '[' || c == '<';
6 1 return c == '(' || c == '{' || c == '[' || c == '<';
1 5 return c == '(' || c == '{' || c == '[' || c == '<';
94 26 0 if (p + 1 >= end || *(p + 1) != '<')
15 11 if (p + 1 >= end || *(p + 1) != '<')
99 11 0 if (p < end && *p == '~') {
1 10 if (p < end && *p == '~') {
105 11 0 if (p < end && (*p == '\'' || *p == '"' || *p == '`')) {
7 4 if (p < end && (*p == '\'' || *p == '"' || *p == '`')) {
6 1 if (p < end && (*p == '\'' || *p == '"' || *p == '`')) {
0 6 if (p < end && (*p == '\'' || *p == '"' || *p == '`')) {
112 55 0 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
44 11 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
0 11 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
115 11 0 if (len == 0 || len >= ESHU_PL_HEREDOC_MAX)
0 11 if (len == 0 || len >= ESHU_PL_HEREDOC_MAX)
119 5 6 if (quote && (p >= end || *p != quote))
5 0 if (quote && (p >= end || *p != quote))
0 5 if (quote && (p >= end || *p != quote))
141 3 38 if (ctx->heredoc_indented) {
142 15 0 while (p < eol && (*p == ' ' || *p == '\t'))
12 3 while (p < eol && (*p == ' ' || *p == '\t'))
0 3 while (p < eol && (*p == ' ' || *p == '\t'))
149 0 41 if (len < ctx->heredoc_tag_len)
152 30 11 if (memcmp(p, ctx->heredoc_tag, ctx->heredoc_tag_len) != 0)
157 0 11 while (p < eol) {
158 0 0 if (*p != ' ' && *p != '\t' && *p != ';')
0 0 if (*p != ' ' && *p != '\t' && *p != ';')
0 0 if (*p != ' ' && *p != '\t' && *p != ';')
170 537 9 if (*content != '=')
173 9 0 if (content + 1 >= eol || !isalpha((unsigned char)content[1]))
0 9 if (content + 1 >= eol || !isalpha((unsigned char)content[1]))
176 9 0 if (eol - content >= 4 && memcmp(content, "=cut", 4) == 0)
0 9 if (eol - content >= 4 && memcmp(content, "=cut", 4) == 0)
183 3 224 if (len < 4) return 0;
184 216 8 if (memcmp(content, "=cut", 4) != 0) return 0;
186 0 8 if (len > 4 && content[4] != ' ' && content[4] != '\t')
0 0 if (len > 4 && content[4] != ' ' && content[4] != '\t')
0 0 if (len > 4 && content[4] != ' ' && content[4] != '\t')
216 25 5 if (eshu_pl_is_paired(delim)) {
241 15 557 if (c == 'q') {
243 15 0 if (p < end && *(p) == 'w') {
11 4 if (p < end && *(p) == 'w') {
245 4 0 } else if (p < end && *(p) == 'q') {
1 3 } else if (p < end && *(p) == 'q') {
247 3 0 } else if (p < end && *(p) == 'x') {
0 3 } else if (p < end && *(p) == 'x') {
249 3 0 } else if (p < end && *(p) == 'r') {
2 1 } else if (p < end && *(p) == 'r') {
254 246 311 } else if (c == 's') {
258 1 310 } else if (c == 't' && p + 1 < end && *(p + 1) == 'r') {
1 0 } else if (c == 't' && p + 1 < end && *(p + 1) == 'r') {
1 0 } else if (c == 't' && p + 1 < end && *(p + 1) == 'r') {
262 3 307 } else if (c == 'y') {
266 307 0 } else if (c == 'm') {
274 0 572 if (p >= end)
276 29 543 if (isalnum((unsigned char)*p) || *p == '_')
0 29 if (isalnum((unsigned char)*p) || *p == '_')
278 25 4 if (*p == ' ' || *p == '\t' || *p == '\n')
25 0 if (*p == ' ' || *p == '\t' || *p == '\n')
0 25 if (*p == ' ' || *p == '\t' || *p == '\n')
289 365 486 if (p <= line_start)
291 207 279 return isalnum((unsigned char)*(p - 1)) || *(p - 1) == '_';
0 207 return isalnum((unsigned char)*(p - 1)) || *(p - 1) == '_';
305 12061 1196 while (p < end) {
310 9685 576 if (c == '{' || c == '(' || c == '[') {
9441 244 if (c == '{' || c == '(' || c == '[') {
40 9401 if (c == '{' || c == '(' || c == '[') {
313 8823 578 } else if (c == '}' || c == ')' || c == ']') {
8581 242 } else if (c == '}' || c == ')' || c == ']') {
40 8541 } else if (c == '}' || c == ')' || c == ']') {
315 0 860 if (ctx->depth < 0) ctx->depth = 0;
317 39 8502 } else if (c == '"') {
320 91 8411 } else if (c == '\'') {
323 42 8369 } else if (c == '#') {
327 26 8343 } else if (c == '<' && eshu_pl_detect_heredoc(ctx, p, end)) {
11 15 } else if (c == '<' && eshu_pl_detect_heredoc(ctx, p, end)) {
331 11 0 if (p < end && *p == '~') p++;
1 10 if (p < end && *p == '~') p++;
332 11 0 if (p < end && (*p == '\'' || *p == '"' || *p == '`')) {
7 4 if (p < end && (*p == '\'' || *p == '"' || *p == '`')) {
6 1 if (p < end && (*p == '\'' || *p == '"' || *p == '`')) {
0 6 if (p < end && (*p == '\'' || *p == '"' || *p == '`')) {
334 23 0 while (p < end && *p != hq) p++;
18 5 while (p < end && *p != hq) p++;
335 5 0 if (p < end) p++;
337 32 0 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
26 6 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
0 6 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
342 20 8338 } else if (c == '/' && eshu_pl_expects_regex(ctx)) {
15 5 } else if (c == '/' && eshu_pl_expects_regex(ctx)) {
347 8328 15 } else if ((c == 'q' || c == 'm' || c == 's' || c == 'y' ||
8021 307 } else if ((c == 'q' || c == 'm' || c == 's' || c == 'y' ||
7775 246 } else if ((c == 'q' || c == 'm' || c == 's' || c == 'y' ||
7500 275 } else if ((c == 'q' || c == 'm' || c == 's' || c == 'y' ||
76 7424 } else if ((c == 'q' || c == 'm' || c == 's' || c == 'y' ||
348 76 0 (c == 't' && p + 1 < end && *(p + 1) == 'r')) &&
351 25 547 if (consumed > 0) {
357 547 0 if (isalnum((unsigned char)c))
359 5 7766 } else if (c == '/' && !eshu_pl_expects_regex(ctx)) {
5 0 } else if (c == '/' && !eshu_pl_expects_regex(ctx)) {
362 6837 929 } else if (c == '$' || c == '@' || c == '%') {
6671 166 } else if (c == '$' || c == '@' || c == '%') {
39 6632 } else if (c == '$' || c == '@' || c == '%') {
366 5699 0 while (p < end && (isalnum((unsigned char)*p) || *p == '_' || *p == ':'))
4392 1307 while (p < end && (isalnum((unsigned char)*p) || *p == '_' || *p == ':'))
149 1158 while (p < end && (isalnum((unsigned char)*p) || *p == '_' || *p == ':'))
24 1134 while (p < end && (isalnum((unsigned char)*p) || *p == '_' || *p == ':'))
369 187 6445 } else if (isdigit((unsigned char)c)) {
371 437 0 while (p < end && (isalnum((unsigned char)*p) || *p == '.' || *p == '_'))
240 197 while (p < end && (isalnum((unsigned char)*p) || *p == '.' || *p == '_'))
6 191 while (p < end && (isalnum((unsigned char)*p) || *p == '.' || *p == '_'))
4 187 while (p < end && (isalnum((unsigned char)*p) || *p == '.' || *p == '_'))
374 453 5992 } else if (c == '=' && p + 1 < end && *(p + 1) == '~') {
453 0 } else if (c == '=' && p + 1 < end && *(p + 1) == '~') {
26 427 } else if (c == '=' && p + 1 < end && *(p + 1) == '~') {
379 4 6415 } else if (c == '!' && p + 1 < end && *(p + 1) == '~') {
4 0 } else if (c == '!' && p + 1 < end && *(p + 1) == '~') {
0 4 } else if (c == '!' && p + 1 < end && *(p + 1) == '~') {
383 3576 2843 } else if (c == ' ' || c == '\t') {
3576 0 } else if (c == ' ' || c == '\t') {
385 2140 1436 } else if (isalpha((unsigned char)c) || c == '_') {
30 2110 } else if (isalpha((unsigned char)c) || c == '_') {
388 7224 2 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
5623 1601 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
137 1464 while (p < end && (isalnum((unsigned char)*p) || *p == '_'))
400 27 503 if (c == '\\' && p + 1 < end) {
27 0 if (c == '\\' && p + 1 < end) {
402 39 464 } else if (c == '"') {
409 1 729 if (c == '\\' && p + 1 < end) {
1 0 if (c == '\\' && p + 1 < end) {
411 91 638 } else if (c == '\'') {
418 11 42 if (c == '\\' && p + 1 < end) {
11 0 if (c == '\\' && p + 1 < end) {
420 15 27 } else if (c == ctx->rx_delim) {
425 19 0 while (p < end && isalpha((unsigned char)*p))
4 15 while (p < end && isalpha((unsigned char)*p))
434 4 483 if (c == '\\' && p + 1 < end && ctx->state != ESHU_QW) {
4 0 if (c == '\\' && p + 1 < end && ctx->state != ESHU_QW) {
4 0 if (c == '\\' && p + 1 < end && ctx->state != ESHU_QW) {
436 445 38 } else if (ctx->q_close != ctx->q_open) {
438 4 441 if (c == ctx->q_open) {
440 29 412 } else if (c == ctx->q_close) {
442 25 4 if (ctx->q_depth == 0) {
444 20 5 if (ctx->q_sections <= 0) {
449 29 0 while (p < end && isalpha((unsigned char)*p))
9 20 while (p < end && isalpha((unsigned char)*p))
456 5 0 while (p < end && (*p == ' ' || *p == '\t'))
0 5 while (p < end && (*p == ' ' || *p == '\t'))
0 5 while (p < end && (*p == ' ' || *p == '\t'))
458 5 0 if (p < end) {
469 9 29 if (c == ctx->q_close) {
471 5 4 if (ctx->q_sections <= 0) {
476 8 0 while (p < end && isalpha((unsigned char)*p))
3 5 while (p < end && isalpha((unsigned char)*p))
510 306 1515 if (content >= eol) {
518 1477 38 if (ctx->state == ESHU_HEREDOC || ctx->state == ESHU_HEREDOC_INDENT) {
3 1474 if (ctx->state == ESHU_HEREDOC || ctx->state == ESHU_HEREDOC_INDENT) {
524 11 30 if (eshu_pl_is_heredoc_end(ctx, line_start, eol)) {
533 227 1247 if (ctx->state == ESHU_POD) {
537 8 219 if (eshu_pl_is_pod_end(content, eol))
543 546 701 if (content == line_start && eshu_pl_is_pod_start(content, eol)) {
9 537 if (content == line_start && eshu_pl_is_pod_start(content, eol)) {
551 1226 12 if (ctx->state == ESHU_QW || ctx->state == ESHU_QQ ||
1216 10 if (ctx->state == ESHU_QW || ctx->state == ESHU_QQ ||
552 1216 0 ctx->state == ESHU_Q || ctx->state == ESHU_REGEX) {
0 1216 ctx->state == ESHU_Q || ctx->state == ESHU_REGEX) {
555 22 0 if (ctx->q_close && *content == ctx->q_close)
7 15 if (ctx->q_close && *content == ctx->q_close)
568 950 266 if (*content == '}' || *content == ')' || *content == ']') {
947 3 if (*content == '}' || *content == ')' || *content == ']') {
9 938 if (*content == '}' || *content == ')' || *content == ']') {
570 0 278 if (indent_depth < 0) indent_depth = 0;
581 11 1205 if (ctx->heredoc_pending) {
583 1 10 ctx->state = ctx->heredoc_indented ? ESHU_HEREDOC_INDENT : ESHU_HEREDOC;
604 1821 100 while (p < end) {
607 1818 3 if (eshu_in_range(cfg, line_num)) {
618 1821 0 if (*p == '\n') p++;