You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by jiangxb1987 <gi...@git.apache.org> on 2017/11/14 06:03:15 UTC
[GitHub] spark pull request #19408: [SPARK-22180][CORE] Allow IPv6 address in org.apa...
Github user jiangxb1987 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19408#discussion_r150743565
--- Diff: core/src/test/scala/org/apache/spark/util/UtilsSuite.scala ---
@@ -1146,6 +1146,20 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
}
}
+ test("parseHostPort") {
+ assert(Utils.parseHostPort("abc:123") === (("abc", 123)))
+ assert(Utils.parseHostPort("example.com") === (("example.com", 0)))
+ assert(Utils.parseHostPort("example.com:123") === (("example.com", 123)))
+ assert(Utils.parseHostPort("127.0.0.1") === (("127.0.0.1", 0)))
+ assert(Utils.parseHostPort("127.0.0.1:123") === (("127.0.0.1", 123)))
+ assert(Utils.parseHostPort("2001:db8::1") === (("2001:db8::1", 0)))
+ assert(Utils.parseHostPort("2001:DB8::1") === (("2001:DB8::1", 0)))
+ assert(Utils.parseHostPort("2001:dB8::1") === (("2001:dB8::1", 0)))
+ assert(Utils.parseHostPort("0:0:0:0:0:0:0:0") === (("0:0:0:0:0:0:0:0", 0)))
+ assert(Utils.parseHostPort("::1") === (("::1", 0)))
+ assert(Utils.parseHostPort("[::1]:123") === (("[::1]", 123)))
+ assert(Utils.parseHostPort("[2001:db8:42::1]:123") === (("[2001:db8:42::1]", 123)))
--- End diff --
nit: we should add more test cases to cover the invalid cases.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org