chore: add test for Keyword::lookup_keyword completeness #906
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.
Related issue(s)
Addresses review comment #903 (comment)
Description
Summary of changes
I've added a test so that the
std::fmt:Display
of anyKeyword
can be looked up to recover the original keyword token.This follows the pattern used here: https://github.com/noir-lang/acvm/blob/f57ba57c2bb2597edf2b02fb1321c69cf11993ee/acir/src/circuit/black_box_functions.rs#L200-L211
Keyword::lookup_keyword
also includes some non-keyword entries which might benefit from being split off. Tthey don't entirely gel with the purpose of this function and require us to return anOption<Token>
rather than anOption<Keyword>
which is what I would expect.Dependency additions / changes
I've added strum as a dev dependency
Test additions / changes
Checklist
cargo fmt
with default settings.Additional context