Skip to content

Commit

Permalink
#338: Fixed self-trace.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcatbear committed Oct 16, 2022
1 parent cba4dd7 commit 35df118
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions doc/spec/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@ Needs: impl, utest

The plain text report uses ANSI escape sequences to color the output.

Needs: impl, utest

Covers:

* `req~colored-plain-text-report~1`

Needs: impl, utest

### Plain Text Report ANSI Font Style
`dsn~reporting.plain-text.ansi-font-style~1`

Expand All @@ -381,6 +381,8 @@ Covers:

* `req~colored-plain-text-report~1`

Needs: impl, utest

### HTML Report

#### HTML Report Inlines CSS
Expand Down
2 changes: 1 addition & 1 deletion doc/spec/system_requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ Needs: dsn

##### Monochrome Plain Text Report With Font Style

`req~colored-plain-text-report~1`
`List.of`

The plain text report supports different font styles to visually separate report elements.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ public TreeContentHandler build()
this.handler.setDefaultStartElementListener(startElement -> {
if (startElement.isRootElement())
{
LOG.info(() -> "Found unknown root element " + startElement + ": skip file");
LOG.fine(() -> "Found unknown root element '" + startElement + "': skip file");
this.handler.stopParsing();
}
LOG.warning(() -> "Found unknown element " + startElement);
return;
});

this.handler.addElementListener("specdocument", elem -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/**
* ANSI console font effect sequences
*/
// [impl->dsn~reporting.plain-text.ansi-color~1]
// [impl-> dsn~reporting.plain-text.ansi-font-style~1]
enum AnsiSequence {
/** Reset all font effects */
RESET(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
class ConsoleColorFormatterTest {
private static final TextFormatter FORMATTER = new ConsoleColorFormatter();

// [utest->dsn~reporting.plain-text.ansi-color~1]
@Test
void testFormatOk() {
assertThat(FORMATTER.formatOk("ok"), equalTo("\u001B[32mok\u001B[0m"));
}

// [utest->dsn~reporting.plain-text.ansi-color~1]
@Test
void testFormatNotOk() {
assertThat(FORMATTER.formatNotOk("not ok"), equalTo("\u001B[91mnot ok\u001B[0m"));
}

// [utest->dsn~reporting.plain-text.ansi-color~1]
// [utest-> dsn~reporting.plain-text.ansi-font-style~1]
@Test
void testFormatStrong() {
assertThat(FORMATTER.formatStrong("strong"), equalTo("\u001B[1;36mstrong\u001B[0m"));
Expand Down

0 comments on commit 35df118

Please sign in to comment.