fluid.test_space

Module for testing Fluid nodes using the new I/O system.

Members

Aliases

doesNotDrawImages
alias doesNotDrawImages = doesNotDraw!`a.among("drawImage", "drawHintedImage")`
Undocumented in source.

Functions

doesNotDraw
auto doesNotDraw(Node subject)

Make sure the selected node doesn't draw anything until another node does.

doesNotDrawChildren
auto doesNotDrawChildren(Node parent)

Make sure the parent does not draw any children.

draws
auto draws(Node subject)

Make sure the selected node draws, but doesn't matter what.

drawsWildcard
auto drawsWildcard(string message)
Undocumented in source. Be warned that the author may not have intended to support it.
dumpDraws
auto dumpDraws(Node subject)

Output every draw instruction to stdout (dumpDraws), and, optionally, to an SVG file (dumpDrawsToSVG).

dumpDrawsToSVG
auto dumpDrawsToSVG(Node subject, string filename)

Output every draw instruction to stdout (dumpDraws), and, optionally, to an SVG file (dumpDrawsToSVG).

emits
auto emits(Node subject, string name)

Ensure the node emits a debug signal.

isDrawn
auto isDrawn(Node subject)

Assert true if a node is attempted to be drawn, but the node does not need to draw anything for the assert to succeed.

Bugs

auto functions may generate incorrect mangling. This is worked-around with pragma(mangle).

Examples

import fluid.structs;

Space child, grandchild;

auto root = testSpace(
    layout!1,
    child = vspace(
        layout!2,
        grandchild = vspace(
            layout!3
        ),
    ),
);

root.drawAndAssert(
    root.drawsChild(),
    child.drawsChild(),
);

root.drawAndAssert(
    root.drawsChild(child),
    child.drawsChild(grandchild),
);

root.drawAndAssert(
    root.drawsChild(child),
    child.drawsChild(grandchild),
    grandchild.doesNotDrawChildren(),
    root.doesNotDrawChildren(),
);

root.drawAndAssertFailure(
    root.doesNotDrawChildren(),
);

root.drawAndAssertFailure(
    child.doesNotDrawChildren(),
);

root.drawAndAssert(
    grandchild.doesNotDrawChildren(),
);

root.drawAndAssertFailure(
    grandchild.drawsChild(),
);

root.drawAndAssertFailure(
    root.drawsChild(grandchild),
);

Meta