-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
Usecase
I am writing a new sqllogictest case (I love this tool) and I want to quickly update the expected outputs
For example, given this type of sqllogictest script, I would like to easily update the script (fill in the values of XX and YY)
# Reproducer for https://github.com/apache/arrow-datafusion/issues/3944
statement ok
CREATE TABLE test(
i_item_desc VARCHAR,
d1_date DATE,
d2_date DATE,
d3_date DATE
) as VALUES
('h','2022-12-12','2022-12-5','2022-12-12')
;
# Check greater than
query C
select i_item_desc
from test
where d3_date > d2_date + INTERVAL '1 days';
----
XX
# Check less than
query C
select i_item_desc
from test
where d3_date < d2_date + INTERVAL '1 days';
----
YY
Prior to #4547 (thanks @xxchan and @xudong963 ) I would copy/paste the output from my console into the test file
After #4547 I need to copy/paste a diff and then remove all instances of +
For example, I do
cargo test -p datafusion --test sqllogictests -- datesWhich would print out
[Diff] (-excepted|+actual)
- DD
+ c
+ d
+ e
+ f
+ g
+ h
Which while I can do is quite annoying
Desire
- A way to run sqllogictest that given the input file would produce the expected output file so I can verify the contents and update the script
Implementation Ideas
This is called "test script completion mode" in sqlllogictest https://www.sqlite.org/sqllogictest/doc/trunk/about.wiki
I think the sqllogictest runner binary has some version of this that looks super awesome (and relevant to updating results), here:
Metadata
Metadata
Assignees
Labels
No labels