Repository navigation
docs: ScreenDiff's changed_rows and style_changes get runnable examples - #560
Merged
Merged
Conversation
`changed_rows` gave its example as code inside a sentence, which nothing compiles, and `style_changes` had none. Both now share one doctest scene, the one the prose describes: a reverse-video highlight moving from row 1 to row 2 of a parsed three-row menu. `changed_rows` asserts `[1, 2]`, and `style_changes` asserts the two `(row, before, after)` tuples, `(1, "0-5 reverse", "(none)")` and `(2, "(none)", "0-5 reverse")`. The screens come from `Screen::parse`, so neither doctest needs a terminal and both run on every platform. Each fails when its expected value is changed, checked by editing it; they pass with default, no default and all features, and rustdoc is clean with `-D warnings`. Closes #542 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
changed_rowsgave its example as code inside a sentence, which nothingcompiles, and
style_changeshad none. Both now share one doctest scene,the one the prose describes: a reverse-video highlight moving from row 1
to row 2 of a parsed three-row menu.
changed_rowsasserts[1, 2], andstyle_changesasserts the two(row, before, after)tuples,(1, "0-5 reverse", "(none)")and(2, "(none)", "0-5 reverse").The screens come from
Screen::parse, so neither doctest needs a terminaland both run on every platform. Each fails when its expected value is
changed, checked by editing it; they pass with default, no default and all
features, and rustdoc is clean with
-D warnings.Closes #542