diff options
Diffstat (limited to 'dhcpv6/option_domainsearchlist_test.go')
-rw-r--r-- | dhcpv6/option_domainsearchlist_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dhcpv6/option_domainsearchlist_test.go b/dhcpv6/option_domainsearchlist_test.go index b4d0195..433f710 100644 --- a/dhcpv6/option_domainsearchlist_test.go +++ b/dhcpv6/option_domainsearchlist_test.go @@ -12,13 +12,13 @@ func TestParseOptDomainSearchList(t *testing.T) { 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'c', 'o', 'm', 0, 6, 's', 'u', 'b', 'n', 'e', 't', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'o', 'r', 'g', 0, } - opt, err := ParseOptDomainSearchList(data) + opt, err := parseOptDomainSearchList(data) require.NoError(t, err) require.Equal(t, OptionDomainSearchList, opt.Code()) require.Equal(t, 2, len(opt.DomainSearchList.Labels)) require.Equal(t, "example.com", opt.DomainSearchList.Labels[0]) require.Equal(t, "subnet.example.org", opt.DomainSearchList.Labels[1]) - require.Contains(t, opt.String(), "searchlist=[example.com subnet.example.org]", "String() should contain the correct domain search output") + require.Contains(t, opt.String(), "example.com subnet.example.org", "String() should contain the correct domain search output") } func TestOptDomainSearchListToBytes(t *testing.T) { @@ -26,14 +26,14 @@ func TestOptDomainSearchListToBytes(t *testing.T) { 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'c', 'o', 'm', 0, 6, 's', 'u', 'b', 'n', 'e', 't', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'o', 'r', 'g', 0, } - opt := OptDomainSearchList{ - DomainSearchList: &rfc1035label.Labels{ + opt := OptDomainSearchList( + &rfc1035label.Labels{ Labels: []string{ "example.com", "subnet.example.org", }, }, - } + ) require.Equal(t, expected, opt.ToBytes()) } @@ -42,6 +42,6 @@ func TestParseOptDomainSearchListInvalidLength(t *testing.T) { 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'c', 'o', 'm', 0, 6, 's', 'u', 'b', 'n', 'e', 't', 7, 'e', // truncated } - _, err := ParseOptDomainSearchList(data) + _, err := parseOptDomainSearchList(data) require.Error(t, err, "A truncated OptDomainSearchList should return an error") } |