Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/test/modeA.sql # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / test / modeA.sql` 1177 lines · 34218 bytes Raw Blame History 1 #!sqlite3 2 # 3 # 2025-11-12 4 # 5 # The author disclaims copyright to this source code. In place of 6 # a legal notice, here is a blessing: 7 # 8 # May you do good and not evil. 9 # May you find forgiveness for yourself and forgive others. 10 # May you share freely, never taking more than you give. 11 # 12 #*********************************************************************** 13 # 14 # Test cases for the ".mode" command of the CLI. 15 # To run these tests: 16 # 17 # ./sqlite3 test/modeA.sql 18 # 19 # 20 .open :memory: 21 CREATE TABLE t1(a,b,c,d,e); 22 INSERT INTO t1 VALUES(1,2.5,'three',x'4444',NULL); 23 INSERT INTO t1 SELECT b,c,d,e,a FROM t1; 24 INSERT INTO t1 SELECT d,e,a,b,c FROM t1; 25 .mode box 26 27 .testcase 100 28 SELECT * FROM t1; 29 .check < 335 n 336 337 338 null 339 340 END 341 342 .testcase 551 343 .mode html --null XX 344 SELECT NULL AS n; 345 .check < 347 n 348 349 350 XX 351 352 END 353 354 .testcase 552 355 .nullvalue YY 356 SELECT NULL AS n; 357 .check < 359 n 360 361 362 YY 363 364 END 365 366 .testcase 553 367 .nullvalue 368 SELECT NULL AS n; 369 .check -glob "*sage: .nullvalue STRING*" 370 371 # NULL text is HTML-escaped, and does not change how a string that 372 # happens to look like the NULL text is rendered. 373 .testcase 554 374 .mode html --null 375 SELECT NULL AS n, 'null' AS m; 376 .check < 378 n 379 m 380 381 382 <nil> 383 null 384 385 END 386 387 # Switching to another mode and back restores the default for html. 388 .testcase 555 389 .mode list --null XX 390 .mode html 391 SELECT NULL AS n; 392 .check < 394 n 395 396 397 null 398 399 END 400 .mode line --titlelimit 3 401 .nullvalue "" 402 403 # With "--escape off" a control character in a value is shown by the 404 # columnar modes as a one-column Control Picture symbol. Column widths 405 # must count it as one column, so that the value is not wrapped. 406 # Bug 2026-11-05T22:27:00Z. 407 # 408 .testcase 560 409 .mode box --escape off 410 SELECT 'a'||char(7)||'b' AS x; 411 .check <