Skip to content

Add table-driven lexer tests for keywords and built-in types #388

Closed

Description

@LunaStev

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, fun is a keyword while funny is an identifier.
  • Cover ptr and array, 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 TokenType has an assertion.
  • Prefix/suffix identifier cases are covered.
  • cargo test -p lexer --locked passes.
  • Existing parser behavior is unchanged.

Activity

  1. added
    good first issue
    needs testing
    on Aug 28, 2026
  2. self-assigned this
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions