KeyResult

Undocumented in source.

Constructors

this
this(string value, size_t indent)
Undocumented in source.

Members

Functions

hasValue
bool hasValue()
Undocumented in source. Be warned that the author may not have intended to support it.
print
void print(ResultPrinter printer)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From IResult

toString
string toString()
Undocumented in source.
print
void print(ResultPrinter )
Undocumented in source.

Examples

KeyResult should not dispaly spaces between words with special chars

auto result = new KeyResult!"key"(" row1  row2 ");
auto printer = new MockPrinter();

result.print(printer);
printer.buffer.should.equal(`[info:      key:][info:᛫][primary:row1  row2][info:᛫]`);

KeyResult should dispaly spaces with special chars on space lines

auto result = new KeyResult!"key"("   ");
auto printer = new MockPrinter();

result.print(printer);
printer.buffer.should.equal(`[info:      key:][info:᛫᛫᛫]`);

KeyResult should display no char for empty lines

auto result = new KeyResult!"key"("");
auto printer = new MockPrinter();

result.print(printer);
printer.buffer.should.equal(``);

KeyResult should display special characters with different contexts

auto result = new KeyResult!"key"("row1\n \trow2");
auto printer = new MockPrinter();

result.print(printer);

printer.buffer.should.equal(`[info:      key:][primary:row1][info:↲][primary:` ~ "\n" ~ `][info:         :][info:᛫¤][primary:row2]`);

KeyResult should display custom glyphs with different contexts

scope(exit) {
  ResultGlyphs.resetDefaults;
}

ResultGlyphs.newline = `\n`;
ResultGlyphs.tab = `\t`;
ResultGlyphs.space = ` `;

auto result = new KeyResult!"key"("row1\n \trow2");
auto printer = new MockPrinter();

result.print(printer);

printer.buffer.should.equal(`[info:      key:][primary:row1][info:\n][primary:` ~ "\n" ~ `][info:         :][info: \t][primary:row2]`);

Meta