Integration test helper improvements #6156
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
reorganize write command tests to their own module
make
TestCase::From
more generic for ergonomicsprint doc state during tests for much better debugging
To help with ergonomics,
test::print
was changed to allow explicit newlines in test DSL. The current test DSL currently has no way to express being at the end of a line, save for putting an explicit LF or CRLF inside the#[|]#
. The problem with this approach is that it can add unintended extra new lines if used in conjunction with raw strings, which insert newlines for you.This is a simple attempt to mitigate this problem. If there is an explicit newline character at the end of the selection, and then it is immediately followed by the same newline character at the right end of the selection, this following newline is removed. This way, one can express a cursor at the end of a line explicitly.
fix a bug
test::plain
: it is currently using char indices forString::insert_str
which is supposed to take byte indices. This causes panics on Unicode charactersuse
AppBuilder
more consistently throughout tests to make use of saner defaults and improve readability