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

Add the randomhex() function as a built-in. (CVS 3619)

FossilOrigin-Name: a6001589ab1349f7a6b4af941e9e0fd73d13c1c0
This commit is contained in:
drh
2007-01-29 15:50:05 +00:00
parent 5fecee1557
commit 63cf66f02e
5 changed files with 72 additions and 13 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.55 2006/09/16 21:45:14 drh Exp $
# $Id: func.test,v 1.56 2007/01/29 15:50:06 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -296,6 +296,28 @@ do_test func-9.1 {
SELECT random() is not null;
}
} {1}
do_test func-9.2 {
execsql {
SELECT typeof(random());
}
} {integer}
do_test func-9.3 {
execsql {
SELECT randomhex(32) is not null;
}
} {1}
do_test func-9.4 {
execsql {
SELECT typeof(randomhex(32));
}
} {text}
do_test func-9.5 {
execsql {
SELECT length(randomhex(32)), length(randomhex(-5)),
length(randomhex(2000)), length(randomhex(31));
}
} {32 2 1000 32}
# Use the "sqlite_register_test_function" TCL command which is part of
# the text fixture in order to verify correct operation of some of