purebred-mua / tasty-tmux

Terminal user acceptance testing via tmux
GNU Affero General Public License v3.0
6 stars 0 forks source link

Compare Substring condition against textual interface? #19

Open romanofski opened 4 years ago

romanofski commented 4 years ago

Is your feature request related to a problem? Please describe. After writing a few acceptance tests now, I wonder if it would be more useful to use the Substring conditions only comparing against the textual representation of the output.

Describe the solution you'd like For example, the raw output is:

\ESC[36minbox\ESC[34m \ESC[36marchive\ESC[34m WIP Refactor

so the substring would only compare against strings without control sequences:

inbox archive WIP Refactor

The regexes compare against the raw output.

What I'm not so certain about is, whether that feels as natural as it has occurred to me or whether it should be a different constructor.

Describe alternatives you've considered None

Additional context None

frasertweedale commented 4 years ago

We'd have to parse the ANSI and ignore the sequences. Feels more like an additional constructor arg to specify whether we ignore escape sequences or not... or maybe contramap or something...

romanofski commented 4 years ago

Hm.. that is true... I haven't thought that far. Will have to check what contramap does ..