aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-12-07 17:15:32 +0000
committerdrh <drh@noemail.net>2020-12-07 17:15:32 +0000
commitf6e904bd9243498889ae3e628aeef9f697c728c9 (patch)
tree3f3cc4437603e77f401151dac1083d9a2e8f7a69 /test
parentaeb6bc56280c7961a0c5fe1a1e26a8e51bf8648d (diff)
downloadsqlite-f6e904bd9243498889ae3e628aeef9f697c728c9.tar.gz
sqlite-f6e904bd9243498889ae3e628aeef9f697c728c9.zip
Begin adding new SQL functions that depend on -lm: ceil(), ceiling(),
floor(), ln(), log(), and log10() so far. More to follow. FossilOrigin-Name: 4db5f2f7875f6df78630a7816fc018141a6eee2e295b44fc7627eb66d07881ea
Diffstat (limited to 'test')
-rw-r--r--test/func7.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/func7.test b/test/func7.test
new file mode 100644
index 000000000..c7fce79dd
--- /dev/null
+++ b/test/func7.test
@@ -0,0 +1,35 @@
+# 2020-12-07
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#*************************************************************************
+#
+# Test cases for SQL functions based off the standard math library
+#
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+ifcapable !mathlib {
+ finish_test
+ return
+}
+
+do_execsql_test func7-100 {
+ SELECT ceil(99.9), ceiling(-99.01), floor(17), floor(-17.99);
+} {100.0 -99.0 17 -18.0}
+do_execsql_test func7-110 {
+ SELECT quote(ceil(NULL)), ceil('-99.99');
+} {NULL -99.0}
+do_execsql_test func7-200 {
+ SELECT round(ln(5),2), log(100.0), log(100), log('256',2);
+} {1.61 2.0 2.0 8.0}
+do_execsql_test func7-210 {
+ SELECT ln(-5), log(100.0,-5);
+} {{} {}}
+
+
+finish_test