1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Added printf-4.(2-4) test cases to test new %Q format specifier. (CVS 622)

FossilOrigin-Name: 7d5fc35b5d38230230344b4f70763f75940ab908
This commit is contained in:
chw
2002-06-16 04:56:36 +00:00
parent 0cfcf3fbd1
commit b22f1b58ac
3 changed files with 17 additions and 8 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the sqlite_*_printf() interface.
#
# $Id: printf.test,v 1.4 2001/09/20 01:44:43 drh Exp $
# $Id: printf.test,v 1.5 2002/06/16 04:56:37 chw Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -90,6 +90,15 @@ do_test printf-3.6 {
do_test printf-4.1 {
sqlite_mprintf_str {%d %d A quoted string: '%q'} 1 2 {Hi Y'all}
} {1 2 A quoted string: 'Hi Y''all'}
do_test printf-4.2 {
sqlite_mprintf_str {%d %d A NULL pointer in %%q: '%q'} 1 2
} {1 2 A NULL pointer in %q: '(NULL)'}
do_test printf-4.3 {
sqlite_mprintf_str {%d %d A quoted string: %Q} 1 2 {Hi Y'all}
} {1 2 A quoted string: 'Hi Y''all'}
do_test printf-4.4 {
sqlite_mprintf_str {%d %d A NULL pointer in %%Q: %Q} 1 2
} {1 2 A NULL pointer in %Q: NULL}
do_test printf-5.1 {
set x [sqlite_mprintf_str {%d %d %100000s} 0 0 {Hello}]