From ce1256c0665dcbec31b92fa86d773a55f51d661c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 1 Dec 2021 10:20:31 +0100 Subject: [PATCH] Add an idna test that _ and * characters are preserved Add a idna that checks whether non-character letters like _ and * are preserved when IDN is enabled. This wasn't the case when UseSTD3ASCIIRules were enabled, f.e. _ from _tcp would get mangled to tcp. --- bin/tests/system/idna/tests.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bin/tests/system/idna/tests.sh b/bin/tests/system/idna/tests.sh index d7da8e3427..f45930d44d 100644 --- a/bin/tests/system/idna/tests.sh +++ b/bin/tests/system/idna/tests.sh @@ -347,6 +347,24 @@ idna_enabled_test() { idna_test "$text" "+noidnin +noidnout" "xn--19g" "xn--19g." idna_fail "$text" "+noidnin +idnout" "xn--19g" idna_fail "$text" "+idnin +idnout" "xn--19g" + + + # Test that non-letter characters are preserved in the output. When + # UseSTD3ASCIIRules are enabled, it would mangle non-letter characters like + # `_` (underscore) and `*` (wildcard. + + test="Checking valid non-letter characters" + idna_test "$text" "" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com." + idna_test "$text" "+noidnin +noidnout" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com." + idna_test "$text" "+noidnin +idnout" "*.xn--nxasmq6b.com" "*.βόλοσ.com." + idna_test "$text" "+idnin +noidnout" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com." + idna_test "$text" "+idnin +idnout" "*.xn--nxasmq6b.com" "*.βόλοσ.com." + + idna_test "$text" "" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com." + idna_test "$text" "+noidnin +noidnout" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com." + idna_test "$text" "+noidnin +idnout" "_tcp.xn--nxasmq6b.com" "_tcp.βόλοσ.com." + idna_test "$text" "+idnin +noidnout" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com." + idna_test "$text" "+idnin +idnout" "_tcp.xn--nxasmq6b.com" "_tcp.βόλοσ.com." }