summaryrefslogtreecommitdiffstats
path: root/test/test_sql_regexp.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
commit5068d34c08f951a7ea6257d305a1627b09a95817 (patch)
tree08213e2be853396a3b07ce15dbe222644dcd9a89 /test/test_sql_regexp.sh
parentInitial commit. (diff)
downloadlnav-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 'test/test_sql_regexp.sh')
-rw-r--r--test/test_sql_regexp.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test_sql_regexp.sh b/test/test_sql_regexp.sh
new file mode 100644
index 0000000..d2fc5f8
--- /dev/null
+++ b/test/test_sql_regexp.sh
@@ -0,0 +1,30 @@
+#! /bin/bash
+
+export YES_COLOR=1
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * FROM syslog_log, regexp_capture_into_json(log_body, '"'"'"(?<value>[^"'"'"]+)')" \
+ -c ":write-csv-to -" \
+ ${test_dir}/logfile_syslog.3
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * from regexp_capture_into_json('foo=0x123e;', '(?<key>\w+)=(?<value>[^;]+)')" \
+ ${test_dir}/logfile_syslog.3
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * from regexp_capture_into_json('foo=0x123e;', '(?<key>\w+)=(?<value>[^;]+)', json_object('convert-numbers', json('false')))" \
+ ${test_dir}/logfile_syslog.3
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * from regexp_capture_into_json('foo=0x123e;', '(?<key>\w+)=(?<value>[^;]+)', '{abc')" \
+ ${test_dir}/logfile_syslog.3
+
+run_cap_test ${lnav_test} -n \
+ -c ";SELECT * from regexp_capture_into_json('foo=123e;', '(?<key>\w+)=(?<value>[^;]+)')" \
+ ${test_dir}/logfile_syslog.3
+
+run_cap_test ${lnav_test} -nN \
+ -c ";SELECT * from regexp_capture('abc=def;ghi=jkl;', '^(\w+)=([^;]+);')"
+
+run_cap_test ${lnav_test} -nN \
+ -c ";SELECT * from regexp_capture_into_json('abc=def;ghi=jkl;', '^(\w+)=([^;]+);')"