jayzhan211 opened a new pull request, #27217:
URL: https://github.com/apache/datafusion/pull/27217

   ## Which issue does this PR close?
   
   No issue; docs only.
   
   ## Rationale for this change
   
   Error checks in `.slt` files are hard to read when the message is written as 
an escaped regex, e.g. `operator: SortExec: TopK\(fetch=1\), expr=\[d@4 ASC 
NULLS LAST\]`. 54 such lines were added in the last 300 commits that touched 
sqllogictest files. `--complete` produces this form for one-line errors when 
the message sits on the `statement error` line, but it keeps the plain-text 
form when the expectation is already a `----` block. This PR documents how to 
get the plain-text form.
   
   ## What changes are included in this PR?
   
   A "Cookbook: Testing errors" section in `datafusion/sqllogictest/README.md`:
   - write the expected error as plain text after `----`, filled in by 
`--complete`;
   - end the block with two blank lines. With one, the next record becomes part 
of the expected error: the test fails, and `--complete` deletes that record;
   - keep the one-line regex form for matching part of a message.
   
   ## What is the testing strategy for this PR?
   
   Docs only. I ran the README example through `cargo test --test 
sqllogictests`, including the record after the block and the partial-match form.
   
   ## Are there any user-facing changes?
   
   No.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to