Branch Coverage

XS.xs
Criterion Covered Total %
branch 263 330 79.7


line true false branch
18 583 953 if (ch == ' ') return 1;
19 6 947 if (ch == '\t') return 1;
23 22 925 if (ch == '\n') return 1;
24 2 923 if (ch == '\r') return 1;
25 0 923 if (ch == '\f') return 1;
29 947 589 return charIsSpace(ch) || charIsEndspace(ch);
24 923 return charIsSpace(ch) || charIsEndspace(ch);
32 491 54 if ((ch >= '0') && (ch <= '9')) return 1;
220 271 if ((ch >= '0') && (ch <= '9')) return 1;
36 1351 798 if ((ch >= 'a') && (ch <= 'z')) return 1;
1173 178 if ((ch >= 'a') && (ch <= 'z')) return 1;
37 180 796 if ((ch >= 'A') && (ch <= 'Z')) return 1;
2 178 if ((ch >= 'A') && (ch <= 'Z')) return 1;
38 618 356 if ((ch >= '0') && (ch <= '9')) return 1;
262 356 if ((ch >= '0') && (ch <= '9')) return 1;
39 0 712 if (ch == '_') return 1;
40 51 661 if (ch == '.') return 1;
41 7 654 if (ch == '#') return 1;
42 6 648 if (ch == '@') return 1;
43 12 636 if (ch == '%') return 1;
48 318 513 if (ch == '{') return 1;
49 239 274 if (ch == '}') return 1;
50 35 239 if (ch == ';') return 1;
51 17 222 if (ch == ',') return 1;
52 5 217 if (ch == '~') return 1;
53 5 212 if (ch == '>') return 1;
58 28 549 if (ch == '(') return 1; /* requires leading WS when used in @media */
59 131 418 if (ch == ':') return 1; /* requires leading WS when used in pseudo-selector */
64 31 413 if (ch == ')') return 1; /* requires trailing WS for MSIE */
128 0 1 if (len != node->length)
142 1 7 if (len > node->length)
146 13 0 while (haystack && *haystack) {
13 0 while (haystack && *haystack) {
150 0 13 if (haystack == NULL)
153 3 10 if ((haystack+len) > endofhay)
156 4 6 if (strncasecmp(haystack, string, len) == 0)
171 0 0 if (len > node->length)
181 0 10 if (len > node->length)
204 0 151 if (!node) return 0;
207 1 150 if (!nodeIsCHAR(node,'!')) return 0;
0 1 if (!nodeIsCHAR(node,'!')) return 0;
211 1 0 while (next && nodeIsWHITESPACE(next)) {
0 1 while (next && nodeIsWHITESPACE(next)) {
214 0 1 if (!next) return 0;
217 0 1 if (!nodeIsIDENTIFIER(next)) return 0;
218 1 0 if (nodeEquals(next, "important")) return 1;
235 415 15 while ((p < end) && charIsNumeric(*p)) {
129 286 while ((p < end) && charIsNumeric(*p)) {
241 286 15 if ((p < end) && (*p == '.')) {
34 252 if ((p < end) && (*p == '.')) {
244 34 0 if ((p >= end) || !charIsNumeric(*p))
7 27 if ((p >= end) || !charIsNumeric(*p))
247 72 7 while ((p < end) && charIsNumeric(*p))
52 20 while ((p < end) && charIsNumeric(*p))
253 225 69 if (!sawDigit)
257 82 69 while (p < end) {
259 70 12 if ( ((ch>='a')&&(ch<='z')) || ((ch>='A')&&(ch<='Z')) || (ch=='%') )
0 70 if ( ((ch>='a')&&(ch<='z')) || ((ch>='A')&&(ch<='Z')) || (ch=='%') )
0 12 if ( ((ch>='a')&&(ch<='z')) || ((ch>='A')&&(ch<='Z')) || (ch=='%') )
0 0 if ( ((ch>='a')&&(ch<='z')) || ((ch>='A')&&(ch<='Z')) || (ch=='%') )
12 0 if ( ((ch>='a')&&(ch<='z')) || ((ch>='A')&&(ch<='Z')) || (ch=='%') )
278 0 935 if (set->next_node >= NODE_SET_SIZE) {
309 255 6 if (node->prev)
311 259 2 if (node->next)
317 0 863 if (element->next)
337 20 0 while (offset < doc->length) {
338 0 20 if (buf[offset] == '\\') {
342 1 19 else if (buf[offset] == delimiter) {
365 125 0 while (offset < doc->length) {
366 10 115 if (buf[offset] == '*') {
367 10 0 if (buf[offset+1] == '/') {
386 612 1 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
325 287 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
396 1513 0 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
1212 301 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
411 935 72 while ((doc->offset < doc->length) && (doc->buffer[doc->offset])) {
935 0 while ((doc->offset < doc->length) && (doc->buffer[doc->offset])) {
414 72 863 if (!doc->head)
416 72 863 if (!doc->tail)
420 16 919 if ((doc->buffer[doc->offset] == '/') && (doc->buffer[doc->offset+1] == '*'))
10 6 if ((doc->buffer[doc->offset] == '/') && (doc->buffer[doc->offset+1] == '*'))
422 925 0 else if ((doc->buffer[doc->offset] == '"') || (doc->buffer[doc->offset] == '\''))
1 924 else if ((doc->buffer[doc->offset] == '"') || (doc->buffer[doc->offset] == '\''))
424 288 636 else if (charIsWhitespace(doc->buffer[doc->offset]))
426 301 335 else if (charIsIdentifier(doc->buffer[doc->offset]))
435 863 72 if (node != doc->tail)
455 49 62 while (*str == '0') { str ++; }
459 24 38 if (*str == '.') {
461 36 24 while (*str == '0') { str ++; }
462 12 12 if (charIsNumeric(*str)) {
476 0 14 if (0 == strncmp(str, "em", 2)) { return 1; }
477 0 14 if (0 == strncmp(str, "ex", 2)) { return 1; }
478 0 14 if (0 == strncmp(str, "ch", 2)) { return 1; }
479 0 14 if (0 == strncmp(str, "rem", 3)) { return 1; }
480 0 14 if (0 == strncmp(str, "vw", 2)) { return 1; }
481 0 14 if (0 == strncmp(str, "vh", 2)) { return 1; }
482 0 14 if (0 == strncmp(str, "vmin", 3)) { return 1; }
483 0 14 if (0 == strncmp(str, "vmax", 3)) { return 1; }
484 0 14 if (0 == strncmp(str, "cm", 2)) { return 1; }
485 0 14 if (0 == strncmp(str, "mm", 2)) { return 1; }
486 0 14 if (0 == strncmp(str, "in", 2)) { return 1; }
487 8 6 if (0 == strncmp(str, "px", 2)) { return 1; }
488 0 6 if (0 == strncmp(str, "pt", 2)) { return 1; }
489 0 6 if (0 == strncmp(str, "pc", 2)) { return 1; }
490 0 6 if (0 == strncmp(str, "%", 1)) { return 1; }
500 935 72 while (curr) {
508 7 3 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
7 0 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
2 5 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
514 3 5 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
3 0 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
2 1 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
528 232 69 if (!nodeIsNumber(curr))
536 69 0 if (curr->prev
537 6 63 && (nodeIsCHAR(curr->prev, '-') || nodeIsCHAR(curr->prev, '/'))
0 6 && (nodeIsCHAR(curr->prev, '-') || nodeIsCHAR(curr->prev, '/'))
2 61 && (nodeIsCHAR(curr->prev, '-') || nodeIsCHAR(curr->prev, '/'))
2 0 && (nodeIsCHAR(curr->prev, '-') || nodeIsCHAR(curr->prev, '/'))
538 8 0 && curr->prev->prev
539 7 1 && nodeIsIDENTIFIER(curr->prev->prev))
548 28 34 if (ptr == curr->contents) {
554 8 26 if (skipped == curr->length) {
561 5 21 if (*ptr == '%') {
571 14 7 if (!inFunction && CssIsKnownUnit(ptr)) {
8 6 if (!inFunction && CssIsKnownUnit(ptr)) {
579 5 8 if (*ptr != '.') { ptr --; }
581 12 1 if (ptr != curr->contents) {
589 25 310 if (nodeIsCHAR(curr,'(')) { inFunction = 1; }
25 0 if (nodeIsCHAR(curr,'(')) { inFunction = 1; }
590 25 310 if (nodeIsCHAR(curr,')')) { inFunction = 0; }
25 0 if (nodeIsCHAR(curr,')')) { inFunction = 0; }
614 6 1051 if (!node->can_prune)
623 155 0 if (next && nodeIsBLOCKCOMMENT(next))
0 155 if (next && nodeIsBLOCKCOMMENT(next))
626 152 3 if (prev && nodeIsBLOCKCOMMENT(prev))
4 148 if (prev && nodeIsBLOCKCOMMENT(prev))
629 151 0 if (next && nodeStartsBANGIMPORTANT(next)) {
1 150 if (next && nodeStartsBANGIMPORTANT(next)) {
633 3 147 if (!prev)
636 0 147 if (!next)
642 4 4 if (nodeContains(node,"copyright"))
654 577 0 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
506 71 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
397 109 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
133 264 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
657 444 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
303 141 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
303 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
107 196 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
660 12 325 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
12 0 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
12 0 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
9 3 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
9 0 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
9 0 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
672 1057 72 while (curr) {
683 0 107 if (prev == head)
690 6 15 if (curr == head)
691 0 6 head = prev ? prev : next;
693 15 6 curr = prev ? prev : next;
731 0 72 if (!head) goto cleanup;
736 1 71 if (!head) goto cleanup;
748 674 71 while (curr) {
759 72 72 while (curr) {
785 71 1 if (buffer != NULL) {