Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create test pattern for Spans #1563

Open
Tracked by #1548 ...
alamb opened this issue Nov 26, 2024 · 1 comment
Open
Tracked by #1548 ...

Create test pattern for Spans #1563

alamb opened this issue Nov 26, 2024 · 1 comment

Comments

@alamb
Copy link
Contributor

alamb commented Nov 26, 2024

Part of #1548

Usecase

We would like to add span information through out the rest of the AST structures (see docs in #1549) and list on #1548

In order to support this feature reasonably, we need to be able to test the feature and avoid regressions

Proposal

I think we need some sort of span test.

I recommend

  1. A new test binary like tests/sqlparser_spans.rs

Then add a test that

  1. Parses a SQL string
  2. Check the spans of the AST nodes match what is expected

I think we'll have to use judgement on how fine grained the location information
can / should be.

@alamb
Copy link
Contributor Author

alamb commented Nov 30, 2024

@lustefaniak , given your comments on

We have an extensive internal test suite living in a downstream project using a fork of this library.

I wonder if you have any suggestions here (or maybe a code pointer for the downstream tests that we could possible start looking at?)

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

No branches or pull requests

1 participant