Repository navigation
Increase test coverage. - #85
Merged
Merged
Conversation
Coverage was 74%, with keynote_parser/command_line.py at 0% - the interface nearly everyone actually uses had no tests at all, so argument wiring, defaults and dispatch were unverified. Four new files, parameterized in the style of the existing suite: - test_command_line.py: subcommand dispatch, argument wiring, output defaults (MyDeck.key -> MyDeck, MyDeck -> MyDeck.key), --version, bare invocation printing help, cat with and without --raw, and an unpack/pack round trip. 0% -> 97%. - test_replacement_files.py: parse_json, which reads the documented --replacements format. Covers key_path defaulting, unknown keys being ignored, and the error paths for incomplete entries and malformed JSON. - test_surrogate_pairs.py: from_surrogate_pair and to_surrogate_pair had no direct coverage. Includes the boundary codepoints, hex case handling, and the cases that must be left alone - lone surrogates, pairs in the wrong order, and adjacent BMP escapes that must not be merged. - test_styled_replacement.py: character-index bookkeeping when replacing text that spans several character styles. Per the note in replacement.py, getting this wrong leaves indices pointing past the end of the text, which makes Keynote render a text box 2^16 points tall and crash - so these assert the arithmetic rather than just that a replacement happened. Coverage 74% -> 91%; replacement.py 67% -> 96%, unicode_utils 77% -> 95%. Spot-checked by mutation rather than trusting line counts: breaking the unpack output default, the replacement counter and the surrogate-pair bounds check fails 1, 2 and 18 tests respectively. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0179M4xvAKPGrgKpy4AeCsM7
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.
Mostly Clauded, but reviewed carefully.