1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Added additional tests. No new errors found. (CVS 653)

FossilOrigin-Name: 8924a7f5bab790ab552332d6359028d0d1825e4a
This commit is contained in:
drh
2002-07-01 00:31:36 +00:00
parent a9f9d1c08b
commit 6cbe1f1bc4
5 changed files with 135 additions and 20 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing built-in functions.
#
# $Id: func.test,v 1.13 2002/06/29 02:20:09 drh Exp $
# $Id: func.test,v 1.14 2002/07/01 00:31:36 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -273,4 +273,60 @@ do_test func-9.1 {
}
} {1}
# Use the "sqlite_register_test_function" TCL command which is part of
# the text fixture in order to verify correct operation of some of
# the user-defined SQL function APIs that are not used by the built-in
# functions.
#
db close
set ::DB [sqlite db test.db]
sqlite_register_test_function $::DB testfunc
do_test func-10.1 {
catchsql {
SELECT testfunc(NULL,NULL);
}
} {1 {first argument to test function may not be NULL}}
do_test func-10.2 {
execsql {
SELECT testfunc(
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'int', 1234
);
}
} {1234}
do_test func-10.3 {
execsql {
SELECT testfunc(
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'string', NULL
);
}
} {{}}
do_test func-10.4 {
execsql {
SELECT testfunc(
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'double', 1.234
);
}
} {1.234}
do_test func-10.5 {
execsql {
SELECT testfunc(
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'int', 1234,
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'string', NULL,
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'double', 1.234,
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'int', 1234,
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'string', NULL,
'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'double', 1.234
);
}
} {1.234}
finish_test