sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
sqlite / test / fossildelta.clitest
| 1 | .load ./fossildelta |
| 2 | .mode qbox -quote relaxed |
| 3 | .mode -textjsonb off |
| 4 | .testcase 100 |
| 5 | SELECT op, a1 FROM delta_parse(delta_create(x'01',x'02')); |
| 6 | .check <<END |
| 7 | ╭──────────┬──────────╮ |
| 8 | │ op │ a1 │ |
| 9 | ╞══════════╪══════════╡ |
| 10 | │ SIZE │ 1 │ |
| 11 | │ INSERT │ 1 │ |
| 12 | │ CHECKSUM │ 33554432 │ |
| 13 | ╰──────────┴──────────╯ |
| 14 | END |
| 15 | |
| 16 | .testcase 110 |
| 17 | CREATE TABLE t1(x,y,d); |
| 18 | INSERT INTO t1(x,y) VALUES |
| 19 | (X'01', X'02'), |
| 20 | (X'0101', X'0202'), |
| 21 | (X'010101', X'020202'); |
| 22 | UPDATE t1 SET d = delta_create(x,y); |
| 23 | SELECT x,op,a1,a2 FROM t1, delta_parse(d); |
| 24 | .check <<END |
| 25 | ╭───────────┬──────────┬──────────┬───────────╮ |
| 26 | │ x │ op │ a1 │ a2 │ |
| 27 | ╞═══════════╪══════════╪══════════╪═══════════╡ |
| 28 | │ x'01' │ SIZE │ 1 │ NULL │ |
| 29 | │ x'01' │ INSERT │ 1 │ x'02' │ |
| 30 | │ x'01' │ CHECKSUM │ 33554432 │ NULL │ |
| 31 | │ x'0101' │ SIZE │ 2 │ NULL │ |
| 32 | │ x'0101' │ INSERT │ 2 │ x'0202' │ |
| 33 | │ x'0101' │ CHECKSUM │ 33685504 │ NULL │ |
| 34 | │ x'010101' │ SIZE │ 3 │ NULL │ |
| 35 | │ x'010101' │ INSERT │ 3 │ x'020202' │ |
| 36 | │ x'010101' │ CHECKSUM │ 33686016 │ NULL │ |
| 37 | ╰───────────┴──────────┴──────────┴───────────╯ |
| 38 | END |