(actual, expected, message, options)
| 521 | }; |
| 522 | |
| 523 | var compareBoolean = function(actual, expected, message, options) { |
| 524 | expected = typeof expected === 'string' |
| 525 | ? PathItem.create(expected) |
| 526 | : expected; |
| 527 | if (typeof actual === 'function') { |
| 528 | if (!message) |
| 529 | message = getFunctionMessage(actual); |
| 530 | actual = actual(); |
| 531 | } |
| 532 | var parent, |
| 533 | index, |
| 534 | style = { |
| 535 | strokeColor: 'black', |
| 536 | fillColor: expected && (expected.closed |
| 537 | || expected.firstChild && expected.firstChild.closed && 'yellow') |
| 538 | || null |
| 539 | }; |
| 540 | if (actual) { |
| 541 | parent = actual.parent; |
| 542 | index = actual.index; |
| 543 | // Remove it from parent already now, in case we're comparing children |
| 544 | // of compound-paths, so we can apply styling to them. |
| 545 | if (parent && parent instanceof CompoundPath) { |
| 546 | actual.remove(); |
| 547 | } else { |
| 548 | parent = null; |
| 549 | } |
| 550 | actual.style = style; |
| 551 | } |
| 552 | if (expected) { |
| 553 | expected.style = style; |
| 554 | } |
| 555 | equals(actual, expected, message, Base.set({ rasterize: true }, options)); |
| 556 | if (parent) { |
| 557 | // Insert it back. |
| 558 | parent.insertChild(index, actual); |
| 559 | } |
| 560 | }; |
| 561 | |
| 562 | var createSVG = function(str, attrs) { |
| 563 | // Similar to SvgElement.create(): |
no test coverage detected