assertMatches

A way to assert that the current test terminal's output matches that of another render block.

This can be useful if the current terminal went through a bunch of complex rerenders and events, where you want to now assert that is has settled onto some final state. For example:

testSession { terminal ->
section { ... do some crazy stuff here, much which gets erased ... }.run { ... more crazy stuff ... }

terminal.assertMatches {
green { textLine("Expected final text!") }
}
}

This method will throw an AssertionError containing more information if the two renders don't match.