aboutsummaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2024-06-06 17:38:30 +0000
committerOmar Polo <op@omarpolo.com>2024-06-06 17:38:30 +0000
commit235f5e70ee3c6fc3e78f9d526b7e99f4d6e502cf (patch)
treed7676b336af8ffb0837bb0cc73490f26dca2d790 /regress
parent471cae7e8f4ff67774283b7379a4a82e81ffe077 (diff)
regress: add a test for comments and blanks at the start of the file
Diffstat (limited to 'regress')
-rwxr-xr-xregress/regress3
-rw-r--r--regress/tests.sh17
2 files changed, 19 insertions, 1 deletions
diff --git a/regress/regress b/regress/regress
index 516a78b..47ef460 100755
--- a/regress/regress
+++ b/regress/regress
@@ -20,7 +20,8 @@ fi
run_test test_punycode
run_test test_iri
-# Run configuration dumping test.
+# Run configuration parsing tests.
+run_test test_parse_comments_at_start
run_test test_dump_config
if [ "${SKIP_RUNTIME_TESTS:-0}" -eq 1 ]; then
diff --git a/regress/tests.sh b/regress/tests.sh
index 58711a3..b9f934b 100644
--- a/regress/tests.sh
+++ b/regress/tests.sh
@@ -8,6 +8,23 @@ test_iri() {
./iri_test
}
+test_parse_comments_at_start() {
+ dont_check_server_alive=yes
+
+ cat <<EOF >reg.conf
+# a comment
+
+server "$server_name" {
+ cert "$PWD/localhost.pem"
+ key "$PWD/localhost.key"
+ root "$PWD/testdata"
+ listen on $host port $port
+}
+EOF
+
+ $gmid -n -c reg.conf >/dev/null
+}
+
test_dump_config() {
dont_check_server_alive=yes
gen_config '' ''