Add table-driven lexer tests for keywords and built-in types
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- Half a day
- Newbie friendliness
- 88/100
Research direction
Start with front/lexer/src/ident.rs and inspect TokenType’s keyword and built-in type spellings. Add table-driven tests in a module under front/lexer/tests/, including exact-boundary cases, ptr and array, token lexemes, and line numbers. Run cargo test -p lexer --locked; done means every listed token is asserted and parser behavior remains unchanged.
Written by the indexing model from the issue text.
Description
Why
The lexer currently has no unit tests. Keyword and built-in type classification in front/lexer/src/ident.rs is a compact, stable surface that is well suited to a first contribution.
Scope
- Add table-driven tests in the lexer crate for every language keyword and built-in type spelling.
- Verify exact-boundary behavior: for example,
funis a keyword whilefunnyis an identifier. - Cover
ptrandarray, which intentionally remain identifier tokens for the type parser. - Verify the token lexeme and line number as well as the token kind.
- Do not change the Wave grammar or add new keywords.
Likely files
front/lexer/src/ident.rs- A new test module under
front/lexer/tests/
Completion criteria
- Every keyword and built-in type in
TokenTypehas an assertion. - Prefix/suffix identifier cases are covered.
-
cargo test -p lexer --lockedpasses. - Existing parser behavior is unchanged.
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 44
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wavefnd/Wave
-
ci enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug ci good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
documentation good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
good first issue needs testing
Difficulty 2/5 Half a day Newbie friendliness 84/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·