Skip to main content

Module testing

Module testing 

Source
Expand description

Test factories for creating locations and spanned tokens succinctly.

The lexer and parser now require every token to carry a byte-span. These helpers keep tests concise while enforcing that requirement.

Functions§

make_loc
Make a byte range location
mk_token
Make a single spanned token
mk_tokens
Make a vector of spanned tokens from a list of (Token, start, end)
mk_tokens_with_dummy_span
Create tokens with zero-length spans for convenience in tests that only care about token order.

Type Aliases§

Tokens
Canonical alias for spanned tokens used across tests