Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add test for Keyword::lookup_keyword completeness #906

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

TomAFrench
Copy link
Member

Related issue(s)

Addresses review comment #903 (comment)

Description

Summary of changes

I've added a test so that the std::fmt:Display of any Keyword 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 an Option<Token> rather than an Option<Keyword> which is what I would expect.

Dependency additions / changes

I've added strum as a dev dependency

Test additions / changes

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.
  • This PR requires documentation updates when merged.

Additional context

@TomAFrench TomAFrench requested a review from jfecher February 24, 2023 11:07
@TomAFrench TomAFrench enabled auto-merge February 24, 2023 11:11
@TomAFrench TomAFrench added this pull request to the merge queue Feb 24, 2023
Merged via the queue into master with commit 269269c Feb 24, 2023
@TomAFrench TomAFrench deleted the keyword-lookup-consistency-test branch February 24, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants