1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Test coverage improvements. (CVS 2215)

FossilOrigin-Name: 92f9d2b2f480fccfa6e8b70a1d19058b92a4ea8f
This commit is contained in:
drh
2005-01-15 01:52:31 +00:00
parent 8b07c7178a
commit 018d1a4929
8 changed files with 68 additions and 40 deletions

View File

@ -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);