diff options
Diffstat (limited to 'tests/unit/hostport.cxx')
-rw-r--r-- | tests/unit/hostport.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/hostport.cxx b/tests/unit/hostport.cxx index af60643a..6ca5df8f 100644 --- a/tests/unit/hostport.cxx +++ b/tests/unit/hostport.cxx @@ -80,5 +80,17 @@ int main(int argc, char** argv) doTest("[2001:1234::20:1]:100", "2001:1234::20:1", 100); doTest("[2001:1234::20:1]:5901", "2001:1234::20:1", 5901); + doTest(" 1.2.3.4 ", "1.2.3.4", 5900); + doTest(" 1.2.3.4:5901 ", "1.2.3.4", 5901); + doTest(" 1.2.3.4: 5901 ", "1.2.3.4", 5901); + doTest(" 1.2.3.4 :5901 ", "1.2.3.4", 5901); + doTest(" [1.2.3.4]:5902 ", "1.2.3.4", 5902); + doTest(" :5903 ", "localhost", 5903); + doTest(" ::4 ", "localhost", 4); + doTest(" [::1] ", "::1", 5900); + doTest(" 2001:1234::20:1 ", "2001:1234::20:1", 5900); + doTest(" [2001:1234::20:1] ", "2001:1234::20:1", 5900); + doTest(" [2001:1234::20:1]:5905 ", "2001:1234::20:1", 5905); + return 0; } |