Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for TestParseIP (0.51 sec)

  1. src/net/ip_test.go

    	{"a1:a2:a3:a4::b1:b2:b3:b4", nil}, // Issue 6628
    	{"127.001.002.003", nil},
    	{"::ffff:127.001.002.003", nil},
    	{"123.000.000.000", nil},
    	{"1.2..4", nil},
    	{"0123.0.0.1", nil},
    }
    
    func TestParseIP(t *testing.T) {
    	for _, tt := range parseIPTests {
    		if out := ParseIP(tt.in); !reflect.DeepEqual(out, tt.out) {
    			t.Errorf("ParseIP(%q) = %v, want %v", tt.in, out, tt.out)
    		}
    		if tt.in == "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 01:17:29 UTC 2024
    - 25.7K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/net/interface_test.go

    				}
    				if !routes[0].Destination.Equal(net.IPv6zero) {
    					t.Errorf("case[%s}: destination is not for default route (not zero)", tc.tcase)
    				}
    			}
    		}
    	}
    }
    
    func TestParseIP(t *testing.T) {
    	testCases := []struct {
    		tcase    string
    		ip       string
    		family   AddressFamily
    		success  bool
    		expected net.IP
    	}{
    		{"empty", "", familyIPv4, false, nil},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 10 07:29:34 UTC 2023
    - 33.2K bytes
    - Viewed (0)
Back to top