summaryrefslogtreecommitdiffstats
path: root/test/test_config.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_config.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_config.sh')
-rwxr-xr-xtest/test_config.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/test_config.sh b/test/test_config.sh
new file mode 100755
index 0000000..4722abb
--- /dev/null
+++ b/test/test_config.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+export YES_COLOR=1
+
+export HOME="./test-config"
+export XDG_CONFIG_HOME="./test-config/.config"
+rm -rf ./test-config
+mkdir -p $HOME/.config
+
+# config write global var
+run_cap_test ${lnav_test} -nN \
+ -c ":config /global/foo bar"
+
+# config read global var
+run_cap_test ${lnav_test} -nN \
+ -c ":config /global/foo"
+
+# config bad color
+run_cap_test ${lnav_test} -n \
+ -c ":config /ui/theme-defs/default/styles/text/color #f" \
+ ${test_dir}/logfile_access_log.0
+
+# invalid min-free-space allowed?
+run_cap_test env TMPDIR=tmp ${lnav_test} -n \
+ -c ':config /tuning/archive-manager/min-free-space abc' \
+ ${srcdir}/logfile_syslog.0
+
+# config bad theme
+run_cap_test ${lnav_test} -n \
+ -c ":config /ui/theme baddy" \
+ ${test_dir}/logfile_access_log.0
+
+# config bad theme
+run_cap_test ${lnav_test} -W -n \
+ -I ${test_dir}/bad-config2 \
+ ${test_dir}/logfile_access_log.0
+
+run_cap_test ${lnav_test} -nN \
+ -c ":reset-config /bad/path"