Branch Coverage

XS.xs
Criterion Covered Total %
branch 234 294 79.5


line true false branch
15 479 653 if (ch == ' ') return 1;
16 6 647 if (ch == '\t') return 1;
20 26 649 if (ch == '\n') return 1;
21 2 647 if (ch == '\r') return 1;
22 0 647 if (ch == '\f') return 1;
26 647 485 return charIsSpace(ch) || charIsEndspace(ch);
24 623 return charIsSpace(ch) || charIsEndspace(ch);
29 840 487 if ((ch >= 'a') && (ch <= 'z')) return 1;
751 89 if ((ch >= 'a') && (ch <= 'z')) return 1;
30 91 485 if ((ch >= 'A') && (ch <= 'Z')) return 1;
2 89 if ((ch >= 'A') && (ch <= 'Z')) return 1;
31 351 223 if ((ch >= '0') && (ch <= '9')) return 1;
145 206 if ((ch >= '0') && (ch <= '9')) return 1;
32 0 429 if (ch == '_') return 1;
33 20 409 if (ch == '.') return 1;
34 5 404 if (ch == '#') return 1;
35 6 398 if (ch == '@') return 1;
36 10 388 if (ch == '%') return 1;
41 222 338 if (ch == '{') return 1;
42 155 183 if (ch == '}') return 1;
43 35 148 if (ch == ';') return 1;
44 9 139 if (ch == ',') return 1;
45 5 134 if (ch == '~') return 1;
46 5 129 if (ch == '>') return 1;
51 18 380 if (ch == '(') return 1; /* requires leading WS when used in @media */
52 88 292 if (ch == ':') return 1; /* requires leading WS when used in pseudo-selector */
57 21 268 if (ch == ')') return 1; /* requires trailing WS for MSIE */
114 1 7 if (len > node->length)
118 13 0 while (haystack && *haystack) {
13 0 while (haystack && *haystack) {
121 3 10 if (haystack == NULL)
124 4 6 if (strncasecmp(haystack, string, len) == 0)
138 0 0 if (len > node->length)
147 0 10 if (len > node->length)
168 0 123 if (!node) return 0;
171 1 122 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 635 0 if (node->contents)
210 422 41 while (head) {
219 0 635 if (node->contents)
228 27 635 if (node->length >= len) {
245 207 6 if (node->prev)
247 211 2 if (node->next)
254 0 593 if (element->next)
266 227 9 if (node->length == 1) {
271 9 0 if (node->contents) {
274 28 5 for (idx=0; idxlength; idx++) {
275 4 24 if (charIsEndspace(node->contents[idx])) {
297 20 0 while (offset < doc->length) {
298 0 20 if (buf[offset] == '\\') {
302 1 19 else if (buf[offset] == delimiter) {
325 125 0 while (offset < doc->length) {
326 10 115 if (buf[offset] == '*') {
327 10 0 if (buf[offset+1] == '/') {
346 508 1 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
273 235 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
356 939 0 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
755 184 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
380 635 42 while ((doc.offset < doc.length) && (doc.buffer[doc.offset])) {
635 0 while ((doc.offset < doc.length) && (doc.buffer[doc.offset])) {
383 42 593 if (!doc.head)
385 42 593 if (!doc.tail)
389 11 624 if ((doc.buffer[doc.offset] == '/') && (doc.buffer[doc.offset+1] == '*'))
10 1 if ((doc.buffer[doc.offset] == '/') && (doc.buffer[doc.offset+1] == '*'))
391 625 0 else if ((doc.buffer[doc.offset] == '"') || (doc.buffer[doc.offset] == '\''))
1 624 else if ((doc.buffer[doc.offset] == '"') || (doc.buffer[doc.offset] == '\''))
393 236 388 else if (charIsWhitespace(doc.buffer[doc.offset]))
395 184 204 else if (charIsIdentifier(doc.buffer[doc.offset]))
404 593 42 if (node != doc.tail)
426 90 219 while (*str == '0') { /* leading zeros */
430 31 188 if (*str == '.') { /* decimal point */
433 57 219 while (*str == '0') { /* following zeros */
439 51 168 if (foundZero) {
448 0 16 if (0 == strcmp(str, "em")) { return 1; }
449 0 16 if (0 == strcmp(str, "ex")) { return 1; }
450 0 16 if (0 == strcmp(str, "ch")) { return 1; }
451 0 16 if (0 == strcmp(str, "rem")) { return 1; }
452 0 16 if (0 == strcmp(str, "vw")) { return 1; }
453 0 16 if (0 == strcmp(str, "vh")) { return 1; }
454 0 16 if (0 == strcmp(str, "vmin")) { return 1; }
455 0 16 if (0 == strcmp(str, "vmax")) { return 1; }
456 0 16 if (0 == strcmp(str, "cm")) { return 1; }
457 0 16 if (0 == strcmp(str, "mm")) { return 1; }
458 0 16 if (0 == strcmp(str, "in")) { return 1; }
459 10 6 if (0 == strcmp(str, "px")) { return 1; }
460 0 6 if (0 == strcmp(str, "pt")) { return 1; }
461 0 6 if (0 == strcmp(str, "pc")) { return 1; }
462 5 1 if (0 == strcmp(str, "%")) { return 1; }
472 168 16 if (ptr == NULL) {
484 0 15 if (ptr == NULL) {
489 5 10 if (0 == strcmp(ptr, "%")) { return 1; }
497 0 15 if (ptr == NULL) {
502 0 15 if (*ptr == '\0') { return 1; }
510 635 42 while (curr) {
517 7 3 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
7 0 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
2 5 if (!inMacIeCommentHack && nodeIsMACIECOMMENTHACK(curr)) {
523 3 5 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
3 0 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
2 1 else if (inMacIeCommentHack && !nodeIsMACIECOMMENTHACK(curr)) {
531 15 169 if (CssIsZeroUnit(curr->contents)) {
533 0 15 if (CssIsJustZeros(curr->contents)) {
537 5 10 else if (CssIsZeroPercent(curr->contents)) {
541 5 5 else if (inFunction) {
550 4 1 if (zero != curr->contents) {
567 15 189 if (nodeIsCHAR(curr,'(')) { inFunction = 1; }
15 0 if (nodeIsCHAR(curr,'(')) { inFunction = 1; }
568 15 189 if (nodeIsCHAR(curr,')')) { inFunction = 0; }
15 0 if (nodeIsCHAR(curr,')')) { inFunction = 0; }
592 6 727 if (!node->can_prune)
601 127 0 if (next && nodeIsBLOCKCOMMENT(next))
0 127 if (next && nodeIsBLOCKCOMMENT(next))
604 124 3 if (prev && nodeIsBLOCKCOMMENT(prev))
4 120 if (prev && nodeIsBLOCKCOMMENT(prev))
607 123 0 if (next && nodeStartsBANGIMPORTANT(next)) {
1 122 if (next && nodeStartsBANGIMPORTANT(next)) {
611 3 119 if (!prev)
614 0 119 if (!next)
620 4 4 if (nodeContains(node,"copyright"))
632 398 0 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
353 45 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
286 67 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
109 177 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
635 289 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
205 84 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
205 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
83 122 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
638 12 194 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,'}'))
650 733 42 while (curr) {
661 0 83 if (prev == head)
668 6 15 if (curr == head)
669 0 6 head = prev ? prev : next;
671 15 6 curr = prev ? prev : next;
698 0 42 if (!head) return NULL;
703 1 41 if (!head) return NULL;
715 422 41 while (curr) {
744 41 1 if (buffer != NULL) {