Skip to content

Commit

Permalink
pg_query.proto: Add Token ASCII_36; Add scan test (#211)
Browse files Browse the repository at this point in the history
Postgres's scanner will scan $ into a single token. For example:

    SELECT $identifier;

The parser will later reject this. However, since the scanner returns
this value, we should define a Token for it in the protobuf.

test/scan.c:

* Add a check so the test does not crash if token_kind is NULL, which
  it was before I defined the token. The test now prints an error:

    INVALID result for "...": scan_result token 1 token_kind == NULL

* Make tests constant to prevent accidental modification. Unnecessary
  but could be helpful.
* Define testsCount automatically so it no longer needs to be changed.
* Add an assert to help ensure tests are defined correctly.
  • Loading branch information
evanj authored Oct 3, 2023
1 parent 9b21e32 commit 0281901
Show file tree
Hide file tree
Showing 5 changed files with 536 additions and 517 deletions.
Loading

0 comments on commit 0281901

Please sign in to comment.