Closed FeepingCreature closed 2 years ago
Staring at the Wikipedia page on ANSI, I just noticed that you can turn intense SGR back off without erasing the foreground color. That would be a lot easier... I'll change that tomorrow.
There is also a hefty refactoring of ANSI formatting
That should be its own PR.
I'll remove it tomorrow anyhow.
Alright, ansi.d is gone, now the change in ansi formatting is limited to changing escCodes a bit and adding gray and intense effects. Do you still want it in a separate PR?
hooray!
Annotate your tests with given/when/then steps. Failing steps will be shown in red; successful steps in green.
The goal of this PR is to imitate the output of Python's behave or Node's cucumber.js.
However, instead of defining a library of steps that a feature file is parsed from, it merely adds a set of functions that generate given/when/then lines in the output.
This is (relatively) isolated to its own module
behave.d
, which defines a stateful output class that keeps track of what the last step was, and erases it (with ANSI codes) if non-behave output is required.There is also a hefty refactoring of ANSI formatting that replaces the string-based codes with a token stream. The reason for this is that it is otherwise awkward to "turn (intense) formatting back off", because you need to know which format codes are "on" at that point.
Example from some internal code I used to try it: