mmsql 1.2 - automatic test suite
================================

Needs: mmsql 1.2 (from mmsql.zip) with its help files in the folder
A:/sql, MMBasic 8.00.00b1 or later.

Files (all into the folder of mmsql, e.g. A:/sql):
  mt_prep.bas   prepares: deletes old test files, creates mt_a.db and
                mt_b.db empty, writes mt_wide.csv and mt_q.csv
  mt_1.sql      part 1: SQLite features, .read, dot commands, test data
  mt_2.sql      part 2: round trips .dump/.read, .import, CSV and .output
  mt_run.txt    the block to paste into mmsql

How to run:
  1. CHDIR "A:/sql"
  2. RUN "mt_prep"
  3. RUN "mmsql"
  4. press F3, paste the content of mt_run.txt into the terminal, then F2
  5. at the end "===== RESULT =====" shows the number of tests per part

Expected:
  - mt_1.sql:    67 statement(s) OK, 0 error(s) (the long line of B07
                 counts as one)
  - .import:     wide 3, q 6, t_imp2 6, t_csv 6, t_out 3 row(s)
  - mt_dump.sql: 61 statement(s) OK, 0 error(s)
  - mt_2.sql:    32 statement(s) OK, 0 error(s)
  - RESULT:      part 1 = 24 tests, part 2 = 27 tests, fail 0
  - "Tests that failed": (no rows)
  On the way mt_1.sql shows some output to look at (B08 to C06); the line
  before each one says what should appear.

If a test is missing (fewer tests than expected), a message "Line n: ..."
further up tells which line n of the .sql file it was.

Tested automatically:
  A  SQLite on the CMM2: version, JSON, window functions, recursive WITH,
     STRICT, RIGHT/FULL JOIN, UPSERT, RETURNING, date, concat(), no maths
     functions, 64 bit, LIKE, type affinity
  B  .read: statements over several lines, ; and line breaks in texts,
     comments, two statements in one line (also over 255 characters),
     trigger with BEGIN...END; and CASE, statement and query over 255
     characters, PRAGMA, a dot command that is not allowed
  C  dot commands in .read (to look at): .mode line/list/json/markdown,
     .width, .headers, .separator, .nullvalue, .echo
  D  test data for the round trips; .once with .mode csv; .output with
     .print
  E  .dump and .read: all values and types the same (64 bit, exact REALs,
     Inf, BLOB without control characters, text with control characters,
     600-character text, 300-byte BLOB, empty BLOB, UTF-8, tab, CR LF),
     trigger, STRICT
  F  .import: 30 columns, comma/quote/line break in a field, empty fields,
     a field of 600 characters, empty last line, --skip
  G  CSV export and .output/.print, read back and compared

Not automatic (please by hand):
  editor (F2/F3, wrap, Esc), pasting with paste time, history and
  PgUp/PgDn after a restart, .browse with paging, .insert, .edit,
  .delete, .create, .alter, .restore, .kill, .files, .set screen and
  width 0, Ctrl-C, questions with an open transaction, :memory: at start.

Note: on a PC (Python/SQLite with maths functions) only A12 fails; on the
CMM2 everything must PASS.
