Skip to content

Commit

Permalink
regress: add a test for comments and blanks at the start of the file
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-polo committed Jun 6, 2024
1 parent 471cae7 commit 235f5e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion regress/regress
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions regress/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '' ''
Expand Down

0 comments on commit 235f5e7

Please sign in to comment.