summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_relay_agent_information_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/option_relay_agent_information_test.go')
-rw-r--r--dhcpv4/option_relay_agent_information_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/dhcpv4/option_relay_agent_information_test.go b/dhcpv4/option_relay_agent_information_test.go
index f4f46c9..a3eb3ef 100644
--- a/dhcpv4/option_relay_agent_information_test.go
+++ b/dhcpv4/option_relay_agent_information_test.go
@@ -13,8 +13,14 @@ func TestParseOptRelayAgentInformation(t *testing.T) {
1, 5, 'l', 'i', 'n', 'u', 'x',
2, 4, 'b', 'o', 'o', 't',
}
- opt, err := ParseOptRelayAgentInformation([]byte(""))
+
+ // short bytes
+ opt, err := ParseOptRelayAgentInformation([]byte{})
require.Error(t, err)
+
+ // wrong code
+ opt, err = ParseOptRelayAgentInformation([]byte{1, 2, 1, 0})
+
opt, err = ParseOptRelayAgentInformation(data)
require.NoError(t, err)
require.Equal(t, len(opt.Options), 2)