diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 17:44:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 17:44:55 +0000 |
commit | 5068d34c08f951a7ea6257d305a1627b09a95817 (patch) | |
tree | 08213e2be853396a3b07ce15dbe222644dcd9a89 /test/test_sql_time_func.sh | |
parent | Initial commit. (diff) | |
download | lnav-5068d34c08f951a7ea6257d305a1627b09a95817.tar.xz lnav-5068d34c08f951a7ea6257d305a1627b09a95817.zip |
Adding upstream version 0.11.1.upstream/0.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | test/test_sql_time_func.sh | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/test/test_sql_time_func.sh b/test/test_sql_time_func.sh new file mode 100644 index 0000000..181dd70 --- /dev/null +++ b/test/test_sql_time_func.sh @@ -0,0 +1,71 @@ +#! /bin/bash + +# timeslice('blah') +run_cap_test ./drive_sql "select timeslice('2015-08-07 12:01:00', 'blah')" + +# before 12pm +run_cap_test ./drive_sql "select timeslice('2015-08-07 12:01:00', 'before fri')" + +# not before 12pm +run_cap_test ./drive_sql "select timeslice('2015-08-07 11:59:00', 'after fri')" + +# not before 12pm +run_cap_test ./drive_sql "select timeslice('2015-08-07 11:59:00', 'fri')" + +# before 12pm +run_cap_test ./drive_sql "select timeslice('2015-08-07 12:01:00', 'before 12pm')" + +# not before 12pm +run_cap_test ./drive_sql "select timeslice('2015-08-07 11:59:00', 'before 12pm')" + +# after 12pm +run_cap_test ./drive_sql "select timeslice('2015-08-07 12:01:00', 'after 12pm')" + +# not after 12pm +run_cap_test ./drive_sql "select timeslice('2015-08-07 11:59:00', 'after 12pm')" + +# timeslice() +run_cap_test ./drive_sql "select timeslice()" + +# timeslice('2015-02-01T05:10:00') +run_cap_test ./drive_sql "select timeslice('2015-02-01T05:10:00')" + +# timeslice empty +run_cap_test ./drive_sql "select timeslice('', '')" + +# timeslice abs +run_cap_test ./drive_sql "select timeslice('2015-08-07 12:01:00', '8 am')" + +# timeslice abs +run_cap_test ./drive_sql "select timeslice('2015-08-07 08:00:33', '8 am')" + +# timeslice abs +run_cap_test ./drive_sql "select timeslice('2015-08-07 08:01:33', '8 am')" + +# timeslice(null, null) +run_cap_test ./drive_sql "select timeslice(null, null)" + +# timeslice(null) +run_cap_test ./drive_sql "select timeslice(null)" + +# 100ms slice +run_cap_test ./drive_sql "select timeslice(1616300753.333, '100ms')" + +# timeslice 5m +run_cap_test ./drive_sql "select timeslice('2015-08-07 12:01:00', '5m')" + +# timeslice 1d +run_cap_test ./drive_sql "select timeslice('2015-08-07 12:01:00', '1d')" + +# XXX This is wrong... +# timeslice 1 month +run_cap_test ./drive_sql "select timeslice('2015-08-07 12:01:00', '1 month')" + +# timeslice ms +run_cap_test ./drive_sql "select timediff('2017-01-02T05:00:00.100', '2017-01-02T05:00:00.000')" + +# timeslice day +run_cap_test ./drive_sql "select timediff('today', 'yesterday')" + +# timeslice day +run_cap_test ./drive_sql "select timediff('foo', 'yesterday')" |