Skip to content

Introduce parser_errors spec test suite#137

Open
karreiro wants to merge 1 commit into
mainfrom
liquid-spec-errors
Open

Introduce parser_errors spec test suite#137
karreiro wants to merge 1 commit into
mainfrom
liquid-spec-errors

Conversation

@karreiro
Copy link
Copy Markdown

@karreiro karreiro commented May 15, 2026

Overview

liquid-spec doesn't have many cases covering syntax errors. This PR adds ~2K specs covering nearly every SyntaxError branch across all tags — all additive YAML, no Ruby changes.

Each spec follows this shape:

- name: "assign - missing variable name"
  template: "{% assign = 'hello' %}"
  errors:
    parse_error: "[Liquid syntax error] Syntax Error in 'assign' - Valid syntax: assign [var] = [source]"

How adapters opt in

The suite is opt-in, so existing adapters see nothing new. An adapter that supports strict2 parsing enables the full suite by adding it to their suite list; the existing feature-gating system handles the rest.

Coverage

The specs aim to cover every raise SyntaxError call site in the parser including unguarded parser.consume(type) calls.

@karreiro karreiro force-pushed the liquid-spec-errors branch from 54890e5 to 165af5c Compare May 15, 2026 12:27
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.

1 participant