You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parse the any deparsed or pretty-formatted SQL back and verify the AST matches the original. This ensures the formatting doesn't break the SQL semantics.
4
+
5
+
Please review the test utilities β note that exact SQL string equality is not required. The focus is on comparing the resulting ASTs.
6
+
7
+
Refer to `expectAstMatch` to understand how correctness is validated.
8
+
9
+
The pipeline is:
10
+
parse(sql1) β ast β deparse(ast) β sql2
11
+
While sql2 !== sql1 (textually), a correct round-trip means:
12
+
parse(sql1) === parse(sql2) (AST-level equality).
13
+
14
+
You can see `expectAstMatch` here: packages/deparser/test-utils/index.ts
15
+
16
+
## Testing Process & Workflow
17
+
18
+
**Our systematic approach to fixing deparser issues:**
19
+
20
+
1.**One test at a time**: Focus on individual failing tests using `yarn test --testNamePattern="specific-test"`
21
+
2.**Always check for regressions**: After each fix, run full `yarn test` to ensure no previously passing tests broke
22
+
3.**Track progress**: Update this file with current pass/fail counts after each significant change
23
+
4.**Build before testing**: Always run `yarn build` after code changes before testing
24
+
5.**Clean commits**: Stage files explicitly with `git add <file>`, never use `git add .`
25
+
6.**Tight feedback loops**: Use isolated debug scripts for complex issues, but don't commit them
26
+
27
+
**Workflow**: Make changes β `yarn test --testNamePattern="target-test"` β `yarn test` (check regressions) β Update this file β Commit & push
28
+
29
+
**When committing to TESTS.md, always run all tests β do not use testNamePattern, only `yarn test`**
0 commit comments