Commit Diff


commit - f53f5e5fe13af9ae5b55eda34635e61a5c11b538
commit + 42235e3fc2853ac5c1b0fa355c1dda45d558ee11
blob - 548d55161ede196d3adcbde4dc3fc7251f3c7d32
blob + 13f8acb0eeb5b01583240f55832e5029c725a5a2
--- regress/regress
+++ regress/regress
@@ -20,6 +20,9 @@ fi
 run_test test_punycode
 run_test test_iri
 
+# Run configuration dumping test.
+run_test test_dump_config
+
 if [ "${SKIP_RUNTIME_TESTS:-0}" -eq 1 ]; then
 	echo
 	echo "======================"
blob - 72ad3033ab486662f0be83bf9ce509587507e7a6
blob + 65c4903119b459c01aaa16fad6a557904d08c7b0
--- regress/tests.sh
+++ regress/tests.sh
@@ -6,6 +6,34 @@ test_punycode() {
 test_iri() {
 	dont_check_server_alive=yes
 	./iri_test
+}
+
+test_dump_config() {
+	dont_check_server_alive=yes
+	gen_config '' ''
+
+        exp="$(mktemp)"
+	got="$(mktemp)"
+	cat <<EOF >$exp
+prefork 3
+
+server "localhost" {
+	cert "$PWD/localhost.pem"
+	key "$PWD/localhost.key"
+}
+EOF
+
+	$gmid -nn -c reg.conf > $got 2>/dev/null
+
+	ret=0
+	if ! cmp -s "$exp" "$got"; then
+    		echo "config differs!" >&2
+    		diff -u "$exp" "$got" >&2
+    		ret=1
+	fi
+
+	rm "$exp" "$got"
+	return $ret
 }
 
 test_gemexp() {