So the .help on .testcase says:
.testcase NAME         Begin redirecting output to 'testcase-out.txt'

And .check says:
.check GLOB            Fail if output since .testcase does not match

So it's a way to check actual TEXT output vs expected TEXT output, right? Since 
I'm not sure of the normal reason for this I just played around with it real 
quick. Here're some tests where I don't know if it's working as intended or 
not. (For below copy/pastes headers default on) 


Windows 7 command prompt

sqlite_source_id()
2016-09-26 12:38:22 fe89225eab777c2c9cb1cbc31092b9e39f516842

------------------------------
.check on its own kills the session and quits back to the command prompt



D:\Temp>sqlite3
SQLite version 3.15.0 2016-09-26 12:38:22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> .check
Usage: .check GLOB-PATTERN

D:\Temp>


------------------------------
Also kills the session if it fails the test.



D:\Temp>sqlite3
SQLite version 3.15.0 2016-09-26 12:38:22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> create table tbl (a int, b text, c real);

sqlite> insert into tbl values (1, 'one', 1.0), (2, 'two', 2.0), (3, 'three', 
3.0);

sqlite> .testcase a

sqlite> select * from tbl where a = 1;

sqlite> .check 1|one|1.0
testcase-a FAILED
 Expected: [1|one|1.0]
      Got: [a|b|c
1|one|1.0
]

D:\Temp>


------------------------------
If testcase-out.txt exists from a previous session then .check looks at it even 
if you didn't do a .testcase on that session:



D:\Temp>sqlite3
SQLite version 3.15.0 2016-09-26 12:38:22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> create table tbl (a int, b text, c real);

sqlite> insert into tbl values (1, 'one', 1.0), (2, 'two', 2.0), (3, 'three', 
3.0);

sqlite> .check a|b|c*
testcase- ok

sqlite>


------------------------------
Doing a .testcase immediately followed by a .check gives an error and quits to 
command prompt.



sqlite> .testcase b

sqlite> .check *
Error: cannot read 'testcase-out.txt'

D:\Temp>



------------------------------
Same thing happens if you do run queries but don't have any returned rows



D:\Temp>sqlite3
SQLite version 3.15.0 2016-09-26 12:38:22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> create table tbl (a int, b text, c real);

sqlite> insert into tbl values (1, 'one', 1.0), (2, 'two', 2.0), (3, 'three', 
3.0);

sqlite> .testcase a

sqlite> select * from tbl where a = 4;

sqlite> .check *
Error: cannot read 'testcase-out.txt'

D:\Temp>



-----Original Message-----
From: David Raymond 
Sent: Friday, September 23, 2016 12:57 PM
To: 'SQLite mailing list'
Subject: RE: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

-Add the ".testcase" and ".check" dot-commands.

Is there documention on what these are? I don't see anything on them in the 
linked CLI page draft.
https://www.sqlite.org/draft/cli.html

-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Richard Hipp
Sent: Thursday, September 22, 2016 3:04 PM
To: General Discussion of SQLite Database
Subject: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

Our current schedule for the next SQLite release (3.15.0) is for 2016-10-14.

Your beta-tests are appreciated.  You can get a pre-release snapshot
from the download page (https://www.sqlite.org/download.html) and you
can review the change log
(https://www.sqlite.org/draft/releaselog/3_15_0.html).

The trunk (https://www.sqlite.org/src/timeline?r=trunk) is stable and
is being used by the SQLite developers for mission-critical processes.

Thank you for your attention.
-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to