3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # The focus of this file is testing the CLI shell tool.
14 # $Id: shell1.test,v 1.7 2009/07/17 16:54:48 shaneh Exp $
19 # shell1-1.*: Basic command line option handling.
20 # shell1-2.*: Basic "dot" command token parsing.
21 # shell1-3.*: Basic test that "dot" command can be called.
24 package require sqlite3
28 proc do_test {name cmd expected} {
29 puts -nonewline "$name ..."
30 set res [uplevel $cmd]
31 if {$res eq $expected} {
36 puts " Expected: $expected"
42 uplevel [list db eval $sql]
46 set rc [catch {uplevel [list db eval $sql]} msg]
50 proc catchcmd {db {cmd ""}} {
52 set out [open cmds.txt w]
55 set line "exec $CLI $db < cmds.txt"
56 set rc [catch { eval $line } msg]
60 file delete -force test.db test.db.journal
63 #----------------------------------------------------------------------------
64 # Test cases shell1-1.*: Basic command line option handling.
68 do_test shell1-1.1.1 {
69 set res [catchcmd "-bad test.db" ""]
70 set rc [lindex $res 0]
72 [regexp {Error: unknown option: -bad} $res]
74 # error on extra options
75 do_test shell1-1.1.2 {
76 set res [catchcmd "-bad test.db \"select 3\" \"select 4\"" ""]
77 set rc [lindex $res 0]
79 [regexp {Error: too many options: "select 4"} $res]
81 # error on extra options
82 do_test shell1-1.1.3 {
83 set res [catchcmd "-bad FOO test.db BAD" ".quit"]
84 set rc [lindex $res 0]
86 [regexp {Error: too many options: "BAD"} $res]
90 do_test shell1-1.2.1 {
91 set res [catchcmd "-help test.db" ""]
92 set rc [lindex $res 0]
94 [regexp {Usage} $res] \
95 [regexp {\-init} $res] \
96 [regexp {\-version} $res]
99 # -init filename read/process named file
100 do_test shell1-1.3.1 {
101 catchcmd "-init FOO test.db" ""
103 do_test shell1-1.3.2 {
104 set res [catchcmd "-init FOO test.db .quit BAD" ""]
105 set rc [lindex $res 0]
107 [regexp {Error: too many options: "BAD"} $res]
110 # -echo print commands before execution
111 do_test shell1-1.4.1 {
112 catchcmd "-echo test.db" ""
115 # -[no]header turn headers on or off
116 do_test shell1-1.5.1 {
117 catchcmd "-header test.db" ""
119 do_test shell1-1.5.2 {
120 catchcmd "-noheader test.db" ""
123 # -bail stop after hitting an error
124 do_test shell1-1.6.1 {
125 catchcmd "-bail test.db" ""
128 # -interactive force interactive I/O
129 do_test shell1-1.7.1 {
130 set res [catchcmd "-interactive test.db" ".quit"]
131 set rc [lindex $res 0]
133 [regexp {SQLite version} $res] \
134 [regexp {Enter SQL statements} $res]
137 # -batch force batch I/O
138 do_test shell1-1.8.1 {
139 catchcmd "-batch test.db" ""
142 # -column set output mode to 'column'
143 do_test shell1-1.9.1 {
144 catchcmd "-column test.db" ""
147 # -csv set output mode to 'csv'
148 do_test shell1-1.10.1 {
149 catchcmd "-csv test.db" ""
152 # -html set output mode to HTML
153 do_test shell1-1.11.1 {
154 catchcmd "-html test.db" ""
157 # -line set output mode to 'line'
158 do_test shell1-1.12.1 {
159 catchcmd "-line test.db" ""
162 # -list set output mode to 'list'
163 do_test shell1-1.13.1 {
164 catchcmd "-list test.db" ""
167 # -separator 'x' set output field separator (|)
168 do_test shell1-1.14.1 {
169 catchcmd "-separator 'x' test.db" ""
171 do_test shell1-1.14.2 {
172 catchcmd "-separator x test.db" ""
174 do_test shell1-1.14.3 {
175 set res [catchcmd "-separator" ""]
176 set rc [lindex $res 0]
178 [regexp {Error: missing argument for option: -separator} $res]
181 # -stats print memory stats before each finalize
182 do_test shell1-1.14b.1 {
183 catchcmd "-stats test.db" ""
186 # -nullvalue 'text' set text string for NULL values
187 do_test shell1-1.15.1 {
188 catchcmd "-nullvalue 'x' test.db" ""
190 do_test shell1-1.15.2 {
191 catchcmd "-nullvalue x test.db" ""
193 do_test shell1-1.15.3 {
194 set res [catchcmd "-nullvalue" ""]
195 set rc [lindex $res 0]
197 [regexp {Error: missing argument for option: -nullvalue} $res]
200 # -version show SQLite version
201 do_test shell1-1.16.1 {
202 catchcmd "-version test.db" ""
205 #----------------------------------------------------------------------------
206 # Test cases shell1-2.*: Basic "dot" command token parsing.
209 # check first token handling
210 do_test shell1-2.1.1 {
211 catchcmd "test.db" ".foo"
212 } {1 {Error: unknown command or invalid arguments: "foo". Enter ".help" for help}}
213 do_test shell1-2.1.2 {
214 catchcmd "test.db" ".\"foo OFF\""
215 } {1 {Error: unknown command or invalid arguments: "foo OFF". Enter ".help" for help}}
216 do_test shell1-2.1.3 {
217 catchcmd "test.db" ".\'foo OFF\'"
218 } {1 {Error: unknown command or invalid arguments: "foo OFF". Enter ".help" for help}}
221 do_test shell1-2.2.1 {
222 catchcmd "test.db" ".\"foo OFF"
223 } {1 {Error: unknown command or invalid arguments: "foo OFF". Enter ".help" for help}}
224 do_test shell1-2.2.2 {
225 catchcmd "test.db" ".\'foo OFF"
226 } {1 {Error: unknown command or invalid arguments: "foo OFF". Enter ".help" for help}}
227 do_test shell1-2.2.3 {
228 catchcmd "test.db" ".explain \"OFF"
230 do_test shell1-2.2.4 {
231 catchcmd "test.db" ".explain \'OFF"
233 do_test shell1-2.2.5 {
234 catchcmd "test.db" ".mode \"insert FOO"
235 } {1 {Error: mode should be one of: column csv html insert line list tabs tcl}}
236 do_test shell1-2.2.6 {
237 catchcmd "test.db" ".mode \'insert FOO"
238 } {1 {Error: mode should be one of: column csv html insert line list tabs tcl}}
240 # check multiple tokens, and quoted tokens
241 do_test shell1-2.3.1 {
242 catchcmd "test.db" ".explain 1"
244 do_test shell1-2.3.2 {
245 catchcmd "test.db" ".explain on"
247 do_test shell1-2.3.3 {
248 catchcmd "test.db" ".explain \"1 2 3\""
250 do_test shell1-2.3.4 {
251 catchcmd "test.db" ".explain \"OFF\""
253 do_test shell1-2.3.5 {
254 catchcmd "test.db" ".\'explain\' \'OFF\'"
256 do_test shell1-2.3.6 {
257 catchcmd "test.db" ".explain \'OFF\'"
259 do_test shell1-2.3.7 {
260 catchcmd "test.db" ".\'explain\' \'OFF\'"
263 # check quoted args are unquoted
264 do_test shell1-2.4.1 {
265 catchcmd "test.db" ".mode FOO"
266 } {1 {Error: mode should be one of: column csv html insert line list tabs tcl}}
267 do_test shell1-2.4.2 {
268 catchcmd "test.db" ".mode csv"
270 do_test shell1-2.4.2 {
271 catchcmd "test.db" ".mode \"csv\""
275 #----------------------------------------------------------------------------
276 # Test cases shell1-3.*: Basic test that "dot" command can be called.
279 # .backup ?DB? FILE Backup DB (default "main") to FILE
280 do_test shell1-3.1.1 {
281 catchcmd "test.db" ".backup"
282 } {1 {Error: unknown command or invalid arguments: "backup". Enter ".help" for help}}
283 do_test shell1-3.1.2 {
284 catchcmd "test.db" ".backup FOO"
286 do_test shell1-3.1.3 {
287 catchcmd "test.db" ".backup FOO BAR"
288 } {1 {Error: unknown database FOO}}
289 do_test shell1-3.1.4 {
291 catchcmd "test.db" ".backup FOO BAR BAD"
292 } {1 {Error: unknown command or invalid arguments: "backup". Enter ".help" for help}}
294 # .bail ON|OFF Stop after hitting an error. Default OFF
295 do_test shell1-3.2.1 {
296 catchcmd "test.db" ".bail"
297 } {1 {Error: unknown command or invalid arguments: "bail". Enter ".help" for help}}
298 do_test shell1-3.2.2 {
299 catchcmd "test.db" ".bail ON"
301 do_test shell1-3.2.3 {
302 catchcmd "test.db" ".bail OFF"
304 do_test shell1-3.2.4 {
306 catchcmd "test.db" ".bail OFF BAD"
307 } {1 {Error: unknown command or invalid arguments: "bail". Enter ".help" for help}}
309 # .databases List names and files of attached databases
310 do_test shell1-3.3.1 {
311 set res [catchcmd "test.db" ".databases"]
312 regexp {0.*main.*test\.db} $res
314 do_test shell1-3.3.2 {
316 catchcmd "test.db" ".databases BAD"
317 } {1 {Error: unknown command or invalid arguments: "databases". Enter ".help" for help}}
319 # .dump ?TABLE? ... Dump the database in an SQL text format
320 # If TABLE specified, only dump tables matching
321 # LIKE pattern TABLE.
322 do_test shell1-3.4.1 {
323 set res [catchcmd "test.db" ".dump"]
324 list [regexp {BEGIN TRANSACTION;} $res] \
325 [regexp {COMMIT;} $res]
327 do_test shell1-3.4.2 {
328 set res [catchcmd "test.db" ".dump FOO"]
329 list [regexp {BEGIN TRANSACTION;} $res] \
330 [regexp {COMMIT;} $res]
332 do_test shell1-3.4.3 {
334 catchcmd "test.db" ".dump FOO BAD"
335 } {1 {Error: unknown command or invalid arguments: "dump". Enter ".help" for help}}
337 # .echo ON|OFF Turn command echo on or off
338 do_test shell1-3.5.1 {
339 catchcmd "test.db" ".echo"
340 } {1 {Error: unknown command or invalid arguments: "echo". Enter ".help" for help}}
341 do_test shell1-3.5.2 {
342 catchcmd "test.db" ".echo ON"
344 do_test shell1-3.5.3 {
345 catchcmd "test.db" ".echo OFF"
347 do_test shell1-3.5.4 {
349 catchcmd "test.db" ".echo OFF BAD"
350 } {1 {Error: unknown command or invalid arguments: "echo". Enter ".help" for help}}
352 # .exit Exit this program
353 do_test shell1-3.6.1 {
354 catchcmd "test.db" ".exit"
356 do_test shell1-3.6.2 {
358 catchcmd "test.db" ".exit BAD"
359 } {1 {Error: unknown command or invalid arguments: "exit". Enter ".help" for help}}
361 # .explain ON|OFF Turn output mode suitable for EXPLAIN on or off.
362 do_test shell1-3.7.1 {
363 catchcmd "test.db" ".explain"
364 # explain is the exception to the booleans. without an option, it turns it on.
366 do_test shell1-3.7.2 {
367 catchcmd "test.db" ".explain ON"
369 do_test shell1-3.7.3 {
370 catchcmd "test.db" ".explain OFF"
372 do_test shell1-3.7.4 {
374 catchcmd "test.db" ".explain OFF BAD"
375 } {1 {Error: unknown command or invalid arguments: "explain". Enter ".help" for help}}
378 # .header(s) ON|OFF Turn display of headers on or off
379 do_test shell1-3.9.1 {
380 catchcmd "test.db" ".header"
381 } {1 {Error: unknown command or invalid arguments: "header". Enter ".help" for help}}
382 do_test shell1-3.9.2 {
383 catchcmd "test.db" ".header ON"
385 do_test shell1-3.9.3 {
386 catchcmd "test.db" ".header OFF"
388 do_test shell1-3.9.4 {
390 catchcmd "test.db" ".header OFF BAD"
391 } {1 {Error: unknown command or invalid arguments: "header". Enter ".help" for help}}
393 do_test shell1-3.9.5 {
394 catchcmd "test.db" ".headers"
395 } {1 {Error: unknown command or invalid arguments: "headers". Enter ".help" for help}}
396 do_test shell1-3.9.6 {
397 catchcmd "test.db" ".headers ON"
399 do_test shell1-3.9.7 {
400 catchcmd "test.db" ".headers OFF"
402 do_test shell1-3.9.8 {
404 catchcmd "test.db" ".headers OFF BAD"
405 } {1 {Error: unknown command or invalid arguments: "headers". Enter ".help" for help}}
407 # .help Show this message
408 do_test shell1-3.10.1 {
409 set res [catchcmd "test.db" ".help"]
410 # look for a few of the possible help commands
411 list [regexp {.help} $res] \
412 [regexp {.quit} $res] \
413 [regexp {.show} $res]
415 do_test shell1-3.10.2 {
416 # we allow .help to take extra args (it is help after all)
417 set res [catchcmd "test.db" ".help BAD"]
418 # look for a few of the possible help commands
419 list [regexp {.help} $res] \
420 [regexp {.quit} $res] \
421 [regexp {.show} $res]
424 # .import FILE TABLE Import data from FILE into TABLE
425 do_test shell1-3.11.1 {
426 catchcmd "test.db" ".import"
427 } {1 {Error: unknown command or invalid arguments: "import". Enter ".help" for help}}
428 do_test shell1-3.11.2 {
429 catchcmd "test.db" ".import FOO"
430 } {1 {Error: unknown command or invalid arguments: "import". Enter ".help" for help}}
431 do_test shell1-3.11.2 {
432 catchcmd "test.db" ".import FOO BAR"
433 } {1 {Error: no such table: BAR}}
434 do_test shell1-3.11.3 {
436 catchcmd "test.db" ".import FOO BAR BAD"
437 } {1 {Error: unknown command or invalid arguments: "import". Enter ".help" for help}}
439 # .indices ?TABLE? Show names of all indices
440 # If TABLE specified, only show indices for tables
441 # matching LIKE pattern TABLE.
442 do_test shell1-3.12.1 {
443 catchcmd "test.db" ".indices"
445 do_test shell1-3.12.2 {
446 catchcmd "test.db" ".indices FOO"
448 do_test shell1-3.12.3 {
450 catchcmd "test.db" ".indices FOO BAD"
451 } {1 {Error: unknown command or invalid arguments: "indices". Enter ".help" for help}}
453 # .mode MODE ?TABLE? Set output mode where MODE is one of:
454 # csv Comma-separated values
455 # column Left-aligned columns. (See .width)
456 # html HTML <table> code
457 # insert SQL insert statements for TABLE
458 # line One value per line
459 # list Values delimited by .separator string
460 # tabs Tab-separated values
461 # tcl TCL list elements
462 do_test shell1-3.13.1 {
463 catchcmd "test.db" ".mode"
464 } {1 {Error: unknown command or invalid arguments: "mode". Enter ".help" for help}}
465 do_test shell1-3.13.2 {
466 catchcmd "test.db" ".mode FOO"
467 } {1 {Error: mode should be one of: column csv html insert line list tabs tcl}}
468 do_test shell1-3.13.3 {
469 catchcmd "test.db" ".mode csv"
471 do_test shell1-3.13.4 {
472 catchcmd "test.db" ".mode column"
474 do_test shell1-3.13.5 {
475 catchcmd "test.db" ".mode html"
477 do_test shell1-3.13.6 {
478 catchcmd "test.db" ".mode insert"
480 do_test shell1-3.13.7 {
481 catchcmd "test.db" ".mode line"
483 do_test shell1-3.13.8 {
484 catchcmd "test.db" ".mode list"
486 do_test shell1-3.13.9 {
487 catchcmd "test.db" ".mode tabs"
489 do_test shell1-3.13.10 {
490 catchcmd "test.db" ".mode tcl"
492 do_test shell1-3.13.11 {
494 catchcmd "test.db" ".mode tcl BAD"
495 } {1 {Error: invalid arguments: "BAD". Enter ".help" for help}}
497 # don't allow partial mode type matches
498 do_test shell1-3.13.12 {
499 catchcmd "test.db" ".mode l"
500 } {1 {Error: mode should be one of: column csv html insert line list tabs tcl}}
501 do_test shell1-3.13.13 {
502 catchcmd "test.db" ".mode li"
503 } {1 {Error: mode should be one of: column csv html insert line list tabs tcl}}
504 do_test shell1-3.13.14 {
505 catchcmd "test.db" ".mode lin"
506 } {1 {Error: mode should be one of: column csv html insert line list tabs tcl}}
508 # .nullvalue STRING Print STRING in place of NULL values
509 do_test shell1-3.14.1 {
510 catchcmd "test.db" ".nullvalue"
511 } {1 {Error: unknown command or invalid arguments: "nullvalue". Enter ".help" for help}}
512 do_test shell1-3.14.2 {
513 catchcmd "test.db" ".nullvalue FOO"
515 do_test shell1-3.14.3 {
517 catchcmd "test.db" ".nullvalue FOO BAD"
518 } {1 {Error: unknown command or invalid arguments: "nullvalue". Enter ".help" for help}}
520 # .output FILENAME Send output to FILENAME
521 do_test shell1-3.15.1 {
522 catchcmd "test.db" ".output"
523 } {1 {Error: unknown command or invalid arguments: "output". Enter ".help" for help}}
524 do_test shell1-3.15.2 {
525 catchcmd "test.db" ".output FOO"
527 do_test shell1-3.15.3 {
529 catchcmd "test.db" ".output FOO BAD"
530 } {1 {Error: unknown command or invalid arguments: "output". Enter ".help" for help}}
532 # .output stdout Send output to the screen
533 do_test shell1-3.16.1 {
534 catchcmd "test.db" ".output stdout"
536 do_test shell1-3.16.2 {
538 catchcmd "test.db" ".output stdout BAD"
539 } {1 {Error: unknown command or invalid arguments: "output". Enter ".help" for help}}
541 # .prompt MAIN CONTINUE Replace the standard prompts
542 do_test shell1-3.17.1 {
543 catchcmd "test.db" ".prompt"
544 } {1 {Error: unknown command or invalid arguments: "prompt". Enter ".help" for help}}
545 do_test shell1-3.17.2 {
546 catchcmd "test.db" ".prompt FOO"
548 do_test shell1-3.17.3 {
549 catchcmd "test.db" ".prompt FOO BAR"
551 do_test shell1-3.17.4 {
553 catchcmd "test.db" ".prompt FOO BAR BAD"
554 } {1 {Error: unknown command or invalid arguments: "prompt". Enter ".help" for help}}
556 # .quit Exit this program
557 do_test shell1-3.18.1 {
558 catchcmd "test.db" ".quit"
560 do_test shell1-3.18.2 {
562 catchcmd "test.db" ".quit BAD"
563 } {1 {Error: unknown command or invalid arguments: "quit". Enter ".help" for help}}
565 # .read FILENAME Execute SQL in FILENAME
566 do_test shell1-3.19.1 {
567 catchcmd "test.db" ".read"
568 } {1 {Error: unknown command or invalid arguments: "read". Enter ".help" for help}}
569 do_test shell1-3.19.2 {
570 file delete -force FOO
571 catchcmd "test.db" ".read FOO"
572 } {1 {Error: cannot open "FOO"}}
573 do_test shell1-3.19.3 {
575 catchcmd "test.db" ".read FOO BAD"
576 } {1 {Error: unknown command or invalid arguments: "read". Enter ".help" for help}}
578 # .restore ?DB? FILE Restore content of DB (default "main") from FILE
579 do_test shell1-3.20.1 {
580 catchcmd "test.db" ".restore"
581 } {1 {Error: unknown command or invalid arguments: "restore". Enter ".help" for help}}
582 do_test shell1-3.20.2 {
583 catchcmd "test.db" ".restore FOO"
585 do_test shell1-3.20.3 {
586 catchcmd "test.db" ".restore FOO BAR"
587 } {1 {Error: unknown database FOO}}
588 do_test shell1-3.20.4 {
590 catchcmd "test.db" ".restore FOO BAR BAD"
591 } {1 {Error: unknown command or invalid arguments: "restore". Enter ".help" for help}}
593 # .schema ?TABLE? Show the CREATE statements
594 # If TABLE specified, only show tables matching
595 # LIKE pattern TABLE.
596 do_test shell1-3.21.1 {
597 catchcmd "test.db" ".schema"
599 do_test shell1-3.21.2 {
600 catchcmd "test.db" ".schema FOO"
602 do_test shell1-3.21.3 {
604 catchcmd "test.db" ".schema FOO BAD"
605 } {1 {Error: unknown command or invalid arguments: "schema". Enter ".help" for help}}
607 # .separator STRING Change separator used by output mode and .import
608 do_test shell1-3.22.1 {
609 catchcmd "test.db" ".separator"
610 } {1 {Error: unknown command or invalid arguments: "separator". Enter ".help" for help}}
611 do_test shell1-3.22.2 {
612 catchcmd "test.db" ".separator FOO"
614 do_test shell1-3.22.3 {
616 catchcmd "test.db" ".separator FOO BAD"
617 } {1 {Error: unknown command or invalid arguments: "separator". Enter ".help" for help}}
619 # .show Show the current values for various settings
620 do_test shell1-3.23.1 {
621 set res [catchcmd "test.db" ".show"]
622 list [regexp {echo:} $res] \
623 [regexp {explain:} $res] \
624 [regexp {headers:} $res] \
625 [regexp {mode:} $res] \
626 [regexp {nullvalue:} $res] \
627 [regexp {output:} $res] \
628 [regexp {separator:} $res] \
629 [regexp {stats:} $res] \
630 [regexp {width:} $res]
631 } {1 1 1 1 1 1 1 1 1}
632 do_test shell1-3.23.2 {
634 catchcmd "test.db" ".show BAD"
635 } {1 {Error: unknown command or invalid arguments: "show". Enter ".help" for help}}
637 # .stats ON|OFF Turn stats on or off
638 do_test shell1-3.23b.1 {
639 catchcmd "test.db" ".stats"
640 } {1 {Error: unknown command or invalid arguments: "stats". Enter ".help" for help}}
641 do_test shell1-3.23b.2 {
642 catchcmd "test.db" ".stats ON"
644 do_test shell1-3.23b.3 {
645 catchcmd "test.db" ".stats OFF"
647 do_test shell1-3.23b.4 {
649 catchcmd "test.db" ".stats OFF BAD"
650 } {1 {Error: unknown command or invalid arguments: "stats". Enter ".help" for help}}
652 # .tables ?TABLE? List names of tables
653 # If TABLE specified, only list tables matching
654 # LIKE pattern TABLE.
655 do_test shell1-3.24.1 {
656 catchcmd "test.db" ".tables"
658 do_test shell1-3.24.2 {
659 catchcmd "test.db" ".tables FOO"
661 do_test shell1-3.24.3 {
663 catchcmd "test.db" ".tables FOO BAD"
664 } {1 {Error: unknown command or invalid arguments: "tables". Enter ".help" for help}}
666 # .timeout MS Try opening locked tables for MS milliseconds
667 do_test shell1-3.25.1 {
668 catchcmd "test.db" ".timeout"
669 } {1 {Error: unknown command or invalid arguments: "timeout". Enter ".help" for help}}
670 do_test shell1-3.25.2 {
671 catchcmd "test.db" ".timeout zzz"
672 # this should be treated the same as a '0' timeout
674 do_test shell1-3.25.3 {
675 catchcmd "test.db" ".timeout 1"
677 do_test shell1-3.25.4 {
679 catchcmd "test.db" ".timeout 1 BAD"
680 } {1 {Error: unknown command or invalid arguments: "timeout". Enter ".help" for help}}
682 # .width NUM NUM ... Set column widths for "column" mode
683 do_test shell1-3.26.1 {
684 catchcmd "test.db" ".width"
685 } {1 {Error: unknown command or invalid arguments: "width". Enter ".help" for help}}
686 do_test shell1-3.26.2 {
687 catchcmd "test.db" ".width xxx"
688 # this should be treated the same as a '0' width for col 1
690 do_test shell1-3.26.3 {
691 catchcmd "test.db" ".width xxx yyy"
692 # this should be treated the same as a '0' width for col 1 and 2
694 do_test shell1-3.26.4 {
695 catchcmd "test.db" ".width 1 1"
696 # this should be treated the same as a '1' width for col 1 and 2
699 # .timer ON|OFF Turn the CPU timer measurement on or off
700 do_test shell1-3.27.1 {
701 catchcmd "test.db" ".timer"
702 } {1 {Error: unknown command or invalid arguments: "timer". Enter ".help" for help}}
703 do_test shell1-3.27.2 {
704 catchcmd "test.db" ".timer ON"
706 do_test shell1-3.27.3 {
707 catchcmd "test.db" ".timer OFF"
709 do_test shell1-3.27.4 {
711 catchcmd "test.db" ".timer OFF BAD"
712 } {1 {Error: unknown command or invalid arguments: "timer". Enter ".help" for help}}
714 puts "CLI tests completed successfully"