Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Fix parsing bugs and add tests to artichoke-readline#2597

Merged
lopopolo merged 4 commits into
trunkfrom
lopopolo/readline-config-more-tests
Jun 11, 2023
Merged

Fix parsing bugs and add tests to artichoke-readline#2597
lopopolo merged 4 commits into
trunkfrom
lopopolo/readline-config-more-tests

Conversation

@lopopolo

Copy link
Copy Markdown
Member

Pair programming with ChatGPT: https://chat.openai.com/c/f1a56877-ed9a-4fa9-92a8-9b0fe4763e82

Changes:

  • Disallow quotes around vi and emacs values in set directive.
  • Permit trailing garbage after a valid set directive.
  • treat vi and emacs directive values as case-insensitive.
  • When the input config contains multiple set directives, the last one wins.

Many more tests are added, generated with help:

  • Integration tests with full configs.
  • Tests with invalid UTF-8 byte strings.
  • Tests with multi-byte UTF-8 characters.
  • Tests with lots of differing variations of whitespace.
  • Tests with comments.
  • Tests with invalid directives.
  • Tests to exercise case-insensitive parsing.

Added some additional comments to the parser to clarify parse steps.

lopopolo added 3 commits June 10, 2023 17:38
Fix some bugs with the help of ChatGPT:

- Quoted values are not allowed in `set` directives per GNU Readline
  documentation.
- Handle trailing garbage after a valid `set` directive.
- `emacs` and `vi` directive values are case insensitive.

Add many more tests:

- Integration tests with full configs.
- Lots of tests with invalid UTF-8 byte sequences.
- Lots of tests with multi-byte UTF-8 characters.

Bump artichoke-readline to v1.0.1.
@lopopolo lopopolo added A-parser Area: Parser implementations. A-frontend Area: Frontends for interpreters, like the `ruby` or `irb` binaries. C-quality Category: Refactoring, cleanup, and quality improvements. labels Jun 11, 2023
@lopopolo
lopopolo merged commit 8a59233 into trunk Jun 11, 2023
@lopopolo
lopopolo deleted the lopopolo/readline-config-more-tests branch June 11, 2023 02:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A-frontend Area: Frontends for interpreters, like the `ruby` or `irb` binaries. A-parser Area: Parser implementations. C-quality Category: Refactoring, cleanup, and quality improvements.

Development

Successfully merging this pull request may close these issues.

1 participant