/ Check-in [4ec2aead]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add comments and improve the new test case.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | expShell
Files: files | file ages | folders
SHA1: 4ec2aeadf949028956e20b72999e2e9cad451922
User & Date: mistachkin 2015-01-19 21:11:31
Context
2015-01-19
21:27
Improve precision of the new test case by removing a superfluous carriage-return from the shell command input. check-in: 913c41b2 user: mistachkin tags: expShell
21:11
Add comments and improve the new test case. check-in: 4ec2aead user: mistachkin tags: expShell
20:22
Remove a shell function that is now superfluous. check-in: d8564f70 user: mistachkin tags: expShell
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/shell1.test.

   830    830       #       cannot be used here.
   831    831       #
   832    832       if {$i==0x0D || ($tcl_platform(platform)=="windows" && $i==0x1A)} {
   833    833         continue
   834    834       }
   835    835       set hex [format %02X $i]
   836    836       set char [subst \\x$hex]; set oldChar $char
   837         -    set char [string map [list \
   838         -        \a \\a \b \\b \t \\t \n \\n \v \\v \f \\f \r \\r \
   839         -        " " "\" \"" \" \\\" ' \"'\" \\ \\\\] $char]
          837  +    set escapes [list]
          838  +    if {$tcl_platform(platform)=="windows"} {
          839  +      #
          840  +      # NOTE: On Windows, we need to escape all the whitespace characters,
          841  +      #       the alarm (\a) character, and those with special meaning to
          842  +      #       the SQLite shell itself.
          843  +      #
          844  +      set escapes [list \
          845  +          \a \\a \b \\b \t \\t \n \\n \v \\v \f \\f \r \\r \
          846  +          " " "\" \"" \" \\\" ' \"'\" \\ \\\\]
          847  +    } else {
          848  +      #
          849  +      # NOTE: On Unix, we need to escape most of the whitespace characters
          850  +      #       and those with special meaning to the SQLite shell itself.
          851  +      #       The alarm (\a), backspace (\b), and carriage-return (\r)
          852  +      #       characters do not appear to require escaping on Unix.  For
          853  +      #       the alarm and backspace characters, this is probably due to
          854  +      #       differences in the command shell.  For the carriage-return,
          855  +      #       it is probably due to differences in how Tcl handles command
          856  +      #       channel end-of-line translations.
          857  +      #
          858  +      set escapes [list \
          859  +          \t \\t \n \\n \v \\v \f \\f \
          860  +          " " "\" \"" \" \\\" ' \"'\" \\ \\\\]
          861  +    }
          862  +    set char [string map $escapes $char]
   840    863       set x [catchcmdex test.db ".print $char\r\n"]
   841    864       set code [lindex $x 0]
   842    865       set res [lindex $x 1]
   843    866       if {$code ne "0"} {
   844    867         error "failed with error: $res"
   845    868       }
   846    869       if {$res ne "$oldChar\n"} {
   847    870         error "failed with byte $hex mismatch"
   848    871       }
   849    872     }
   850    873   } {}
   851    874   
   852    875   finish_test