MockPrinter

Undocumented in source.

Members

Functions

danger
void danger(string val)
Undocumented in source. Be warned that the author may not have intended to support it.
dangerReverse
void dangerReverse(string val)
Undocumented in source. Be warned that the author may not have intended to support it.
info
void info(string val)
Undocumented in source. Be warned that the author may not have intended to support it.
primary
void primary(string val)
Undocumented in source. Be warned that the author may not have intended to support it.
success
void success(string val)
Undocumented in source. Be warned that the author may not have intended to support it.
successReverse
void successReverse(string val)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

buffer
string buffer;
Undocumented in source.

Examples

The frame should print all fields

auto printer = new MockPrinter;
Frame(10, "some.module", "0xffffff", "name", "offset", "file.d", 120).print(printer);

printer.buffer.should.equal(
  `[info:10  ]0xffffff [info:name] at [info:some.module] + [info:offset] ([info:file.d]:[info:120])`
);

The frame should not print an index < 0 or a line < 0

auto printer = new MockPrinter;
Frame(-1, "some.module", "0xffffff", "name", "offset", "file.d", -1).print(printer);

printer.buffer.should.equal(
  `0xffffff [info:name] at [info:some.module] + [info:offset] ([info:file.d])`
);

The frame should not print the file if it's missing

auto printer = new MockPrinter;
Frame(-1, "some.module", "0xffffff", "name", "offset", "", 10).print(printer);

printer.buffer.should.equal(
  `0xffffff [info:name] at [info:some.module] + [info:offset]`
);

The frame should not print the module if it's missing

auto printer = new MockPrinter;
Frame(-1, "", "0xffffff", "name", "offset", "", 10).print(printer);

printer.buffer.should.equal(
  `0xffffff [info:name] + [info:offset]`
);

The frame should not print the offset if it's missing

auto printer = new MockPrinter;
Frame(-1, "", "0xffffff", "name", "", "", 10).print(printer);

printer.buffer.should.equal(
  `0xffffff [info:name]`
);

The frame should print ???? when the name is missing

auto printer = new MockPrinter;
Frame(-1, "", "0xffffff", "", "", "", 10).print(printer);

printer.buffer.should.equal(
  `0xffffff [info:????]`
);

Meta