Branch Coverage

XS.xs
Criterion Covered Total %
branch 235 282 83.3


line true false branch
15 740 1165 if (ch == ' ') return 1;
16 3 1162 if (ch == '\t') return 1;
20 320 1303 if (ch == '\n') return 1;
21 0 1303 if (ch == '\r') return 1;
22 0 1303 if (ch == '\f') return 1;
26 1162 743 return charIsSpace(ch) || charIsEndspace(ch);
217 945 return charIsSpace(ch) || charIsEndspace(ch);
29 1282 719 if ((ch >= 'a') && (ch <= 'z')) return 1;
1139 143 if ((ch >= 'a') && (ch <= 'z')) return 1;
30 145 717 if ((ch >= 'A') && (ch <= 'Z')) return 1;
2 143 if ((ch >= 'A') && (ch <= 'Z')) return 1;
31 504 356 if ((ch >= '0') && (ch <= '9')) return 1;
189 315 if ((ch >= '0') && (ch <= '9')) return 1;
32 0 671 if (ch == '_') return 1;
33 108 563 if (ch == '.') return 1;
34 3 560 if (ch == '#') return 1;
35 4 556 if (ch == '@') return 1;
36 11 545 if (ch == '%') return 1;
41 347 679 if (ch == '{') return 1;
42 313 366 if (ch == '}') return 1;
43 44 322 if (ch == ';') return 1;
44 214 108 if (ch == ':') return 1;
45 12 96 if (ch == ',') return 1;
46 5 91 if (ch == '~') return 1;
47 5 86 if (ch == '>') return 1;
52 17 624 if (ch == '(') return 1; /* requires leading WS when used in @media */
57 18 402 if (ch == ')') return 1; /* requires trailing WS for MSIE */
114 1 22 if (len > node->length)
118 57 0 while (haystack && *haystack) {
57 0 while (haystack && *haystack) {
121 19 38 if (haystack == NULL)
124 3 35 if (strncasecmp(haystack, string, len) == 0)
138 0 0 if (len > node->length)
147 0 23 if (len > node->length)
168 0 175 if (!node) return 0;
171 1 174 if (!nodeIsCHAR(node,'!')) return 0;
0 1 if (!nodeIsCHAR(node,'!')) return 0;
175 1 0 while (next && nodeIsWHITESPACE(next)) {
0 1 while (next && nodeIsWHITESPACE(next)) {
178 0 1 if (!next) return 0;
181 0 1 if (!nodeIsIDENTIFIER(next)) return 0;
182 1 0 if (nodeEquals(next, "important")) return 1;
205 970 0 if (node->contents)
210 565 17 while (head) {
219 440 970 if (node->contents)
236 371 34 if (node->prev)
238 402 3 if (node->next)
245 0 952 if (element->next)
256 401 0 if (node->contents) {
259 461 298 for (idx=0; idxlength; idx++) {
260 103 358 if (charIsEndspace(node->contents[idx])) {
282 20 0 while (offset < doc->length) {
283 0 20 if (buf[offset] == '\\') {
287 1 19 else if (buf[offset] == delimiter) {
310 1291 0 while (offset < doc->length) {
311 27 1264 if (buf[offset] == '*') {
312 23 4 if (buf[offset+1] == '/') {
331 959 1 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
559 400 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
341 1456 0 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
1194 262 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
365 970 19 while ((doc.offset < doc.length) && (doc.buffer[doc.offset])) {
970 0 while ((doc.offset < doc.length) && (doc.buffer[doc.offset])) {
368 18 952 if (!doc.head)
370 18 952 if (!doc.tail)
374 24 946 if ((doc.buffer[doc.offset] == '/') && (doc.buffer[doc.offset+1] == '*'))
23 1 if ((doc.buffer[doc.offset] == '/') && (doc.buffer[doc.offset+1] == '*'))
376 946 1 else if ((doc.buffer[doc.offset] == '"') || (doc.buffer[doc.offset] == '\''))
0 946 else if ((doc.buffer[doc.offset] == '"') || (doc.buffer[doc.offset] == '\''))
378 401 545 else if (charIsWhitespace(doc.buffer[doc.offset]))
380 262 283 else if (charIsIdentifier(doc.buffer[doc.offset]))
389 952 18 if (node != doc.tail)
411 97 299 while (*str == '0') { /* leading zeros */
415 47 252 if (*str == '.') { /* decimal point */
418 36 299 while (*str == '0') { /* following zeros */
424 79 220 if (foundZero) {
433 4 38 if (0 == strcmp(str, "em")) { return 1; }
434 4 34 if (0 == strcmp(str, "ex")) { return 1; }
435 0 34 if (0 == strcmp(str, "ch")) { return 1; }
436 0 34 if (0 == strcmp(str, "rem")) { return 1; }
437 0 34 if (0 == strcmp(str, "vw")) { return 1; }
438 0 34 if (0 == strcmp(str, "vh")) { return 1; }
439 0 34 if (0 == strcmp(str, "vmin")) { return 1; }
440 0 34 if (0 == strcmp(str, "vmax")) { return 1; }
441 4 30 if (0 == strcmp(str, "cm")) { return 1; }
442 4 26 if (0 == strcmp(str, "mm")) { return 1; }
443 4 22 if (0 == strcmp(str, "in")) { return 1; }
444 8 14 if (0 == strcmp(str, "px")) { return 1; }
445 4 10 if (0 == strcmp(str, "pt")) { return 1; }
446 4 6 if (0 == strcmp(str, "pc")) { return 1; }
447 4 2 if (0 == strcmp(str, "%")) { return 1; }
457 220 42 if (ptr == NULL) {
469 0 37 if (ptr == NULL) {
474 4 33 if (0 == strcmp(ptr, "%")) { return 1; }
482 970 18 while (curr) {
489 21 2 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
21 0 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
1 20 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
495 2 20 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
2 0 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
1 1 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
503 40 222 if (CssIsZeroUnit(curr->contents) && !inFunction) {
37 3 if (CssIsZeroUnit(curr->contents) && !inFunction) {
504 4 33 if (CssIsZeroPercent(curr->contents)) {
512 12 533 if (nodeIsCHAR(curr,'(')) { inFunction = 1; }
12 0 if (nodeIsCHAR(curr,'(')) { inFunction = 1; }
513 12 533 if (nodeIsCHAR(curr,')')) { inFunction = 0; }
12 0 if (nodeIsCHAR(curr,')')) { inFunction = 0; }
536 3 1117 if (!node->can_prune)
545 180 0 if (next && nodeIsBLOCKCOMMENT(next))
4 176 if (next && nodeIsBLOCKCOMMENT(next))
548 162 14 if (prev && nodeIsBLOCKCOMMENT(prev))
1 161 if (prev && nodeIsBLOCKCOMMENT(prev))
551 175 0 if (next && nodeStartsBANGIMPORTANT(next)) {
1 174 if (next && nodeStartsBANGIMPORTANT(next)) {
555 14 160 if (!prev)
558 0 160 if (!next)
564 3 20 if (nodeContains(node,"copyright"))
576 641 0 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
595 46 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
571 24 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
221 350 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
579 420 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
380 40 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
380 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
134 246 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
582 14 272 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
14 0 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
14 0 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
10 4 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
10 0 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
10 0 if (nodeIsCHAR(node,';') && next && nodeIsSIGIL(next) && nodeIsCHAR(next,'}'))
594 1120 18 while (curr) {
605 0 134 if (prev == head)
612 34 16 if (curr == head)
613 0 34 head = prev ? prev : next;
615 16 34 curr = prev ? prev : next;
642 1 18 if (!head) return NULL;
647 1 17 if (!head) return NULL;
659 565 17 while (curr) {
688 17 2 if (buffer != NULL) {