mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Test coverage improvements. (CVS 2215)
FossilOrigin-Name: 92f9d2b2f480fccfa6e8b70a1d19058b92a4ea8f
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing date and time functions.
|
||||
#
|
||||
# $Id: date.test,v 1.11 2004/10/31 02:22:50 drh Exp $
|
||||
# $Id: date.test,v 1.12 2005/01/15 01:52:33 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -55,6 +55,8 @@ datetest 1.22 {julianday('2000-01-01 12:00:00.')} NULL
|
||||
datetest 1.23 julianday(12345.6) 12345.6
|
||||
datetest 1.24 {julianday('2001-01-01 12:00:00 bogus')} NULL
|
||||
datetest 1.25 {julianday('2001-01-01 bogus')} NULL
|
||||
datetest 1.26 {julianday('2001-01-01 12:60:00')} NULL
|
||||
datetest 1.27 {julianday('2001-01-01 12:59:60')} NULL
|
||||
|
||||
datetest 2.1 datetime(0,'unixepoch') {1970-01-01 00:00:00}
|
||||
datetest 2.2 datetime(946684800,'unixepoch') {2000-01-01 00:00:00}
|
||||
@ -140,6 +142,7 @@ datetest 5.1 {datetime('1994-04-16 14:00:00 -05:00')} {1994-04-16 09:00:00}
|
||||
datetest 5.2 {datetime('1994-04-16 14:00:00 +05:15')} {1994-04-16 19:15:00}
|
||||
datetest 5.3 {datetime('1994-04-16 05:00:00 -08:30')} {1994-04-15 20:30:00}
|
||||
datetest 5.4 {datetime('1994-04-16 14:00:00 +11:55')} {1994-04-17 01:55:00}
|
||||
datetest 5.5 {datetime('1994-04-16 14:00:00 +11:60')} NULL
|
||||
|
||||
# localtime->utc and utc->localtime conversions. These tests only work
|
||||
# if the localtime is in the US Eastern Time (the time in Charlotte, NC
|
||||
@ -258,6 +261,7 @@ datetest 11.8 {datetime('2004-02-28 20:00:00', '11:59')} \
|
||||
{2004-02-29 07:59:00}
|
||||
datetest 11.9 {datetime('2004-02-28 20:00:00', '12:01')} \
|
||||
{2004-02-29 08:01:00}
|
||||
datetest 11.10 {datetime('2004-02-28 20:00:00', '12:60')} NULL
|
||||
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# focus of this file is testing the LIMIT ... OFFSET ... clause
|
||||
# of SELECT statements.
|
||||
#
|
||||
# $Id: limit.test,v 1.19 2004/12/16 21:09:18 drh Exp $
|
||||
# $Id: limit.test,v 1.20 2005/01/15 01:52:33 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -348,5 +348,12 @@ do_test limit-9.4 {
|
||||
LIMIT 2
|
||||
}
|
||||
} {1 2}
|
||||
do_test limit-9.5 {
|
||||
catchsql {
|
||||
SELECT * FROM t6 LIMIT 3
|
||||
UNION
|
||||
SELECT * FROM t7 LIMIT 3
|
||||
}
|
||||
} {1 {LIMIT clause should come after UNION not before}}
|
||||
|
||||
finish_test
|
||||
|
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the SELECT statement.
|
||||
#
|
||||
# $Id: select1.test,v 1.37 2004/11/22 13:35:42 danielk1977 Exp $
|
||||
# $Id: select1.test,v 1.38 2005/01/15 01:52:33 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -291,11 +291,26 @@ do_test select1-4.6 {
|
||||
SELECT f1 FROM test1 ORDER BY '8.4';
|
||||
}
|
||||
} {1 {ORDER BY terms must not be non-integer constants}}
|
||||
do_test select1-4.7 {
|
||||
do_test select1-4.7.1 {
|
||||
catchsql {
|
||||
SELECT f1 FROM test1 ORDER BY 'xyz';
|
||||
}
|
||||
} {1 {ORDER BY terms must not be non-integer constants}}
|
||||
do_test select1-4.7.2 {
|
||||
catchsql {
|
||||
SELECT f1 FROM test1 ORDER BY -8.4;
|
||||
}
|
||||
} {1 {ORDER BY terms must not be non-integer constants}}
|
||||
do_test select1-4.7.3 {
|
||||
catchsql {
|
||||
SELECT f1 FROM test1 ORDER BY +8.4;
|
||||
}
|
||||
} {1 {ORDER BY terms must not be non-integer constants}}
|
||||
do_test select1-4.7.4 {
|
||||
catchsql {
|
||||
SELECT f1 FROM test1 ORDER BY 4294967296; -- constant larger than 32 bits
|
||||
}
|
||||
} {1 {ORDER BY terms must not be non-integer constants}}
|
||||
do_test select1-4.8 {
|
||||
execsql {
|
||||
CREATE TABLE t5(a,b);
|
||||
@ -304,16 +319,26 @@ do_test select1-4.8 {
|
||||
SELECT * FROM t5 ORDER BY 1;
|
||||
}
|
||||
} {1 10 2 9}
|
||||
do_test select1-4.9 {
|
||||
do_test select1-4.9.1 {
|
||||
execsql {
|
||||
SELECT * FROM t5 ORDER BY 2;
|
||||
}
|
||||
} {2 9 1 10}
|
||||
do_test select1-4.10 {
|
||||
do_test select1-4.9.2 {
|
||||
execsql {
|
||||
SELECT * FROM t5 ORDER BY +2;
|
||||
}
|
||||
} {2 9 1 10}
|
||||
do_test select1-4.10.1 {
|
||||
catchsql {
|
||||
SELECT * FROM t5 ORDER BY 3;
|
||||
}
|
||||
} {1 {ORDER BY column number 3 out of range - should be between 1 and 2}}
|
||||
do_test select1-4.10.2 {
|
||||
catchsql {
|
||||
SELECT * FROM t5 ORDER BY -1;
|
||||
}
|
||||
} {1 {ORDER BY column number -1 out of range - should be between 1 and 2}}
|
||||
do_test select1-4.11 {
|
||||
execsql {
|
||||
INSERT INTO t5 VALUES(3,10);
|
||||
|
Reference in New Issue
Block a user