Kaynağa Gözat

Fix targeting tests; IP targets are now enclosed in []'s

Ask Bjørn Hansen 11 yıl önce
ebeveyn
işleme
75bbf577a8
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      targeting_test.go

+ 3 - 3
targeting_test.go

@@ -1,8 +1,8 @@
 package main
 
 import (
-	. "launchpad.net/gocheck"
 	"net"
+	. "launchpad.net/gocheck"
 )
 
 type TargetingSuite struct {
@@ -36,7 +36,7 @@ func (s *TargetingSuite) TestTargetParse(c *C) {
 }
 func (s *TargetingSuite) TestGetTargets(c *C) {
 
-	ip := net.ParseIP("207.171.7.51")
+	ip := net.ParseIP("207.171.1.1")
 
 	geoIP.setupGeoIPCity()
 	geoIP.setupGeoIPCountry()
@@ -61,5 +61,5 @@ func (s *TargetingSuite) TestGetTargets(c *C) {
 
 	tgt, _ = parseTargets("@ continent regiongroup country region asn ip")
 	targets, _ = tgt.GetTargets(ip)
-	c.Check(targets, DeepEquals, []string{"207.171.7.51", "207.171.7.0", "as53582", "us-ca", "us-west", "us", "north-america", "@"})
+	c.Check(targets, DeepEquals, []string{"[207.171.1.1]", "[207.171.1.0]", "as7012", "us-ca", "us-west", "us", "north-america", "@"})
 }