summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/options_test.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2018-08-15 14:07:40 +0100
committerinsomniac <insomniacslk@users.noreply.github.com>2018-08-15 14:07:40 +0100
commit4502285c06f712f419ca9f30fb84283bcdb01d62 (patch)
tree78da72cc5681ede7f2d6ac9616b14394b214f190 /dhcpv4/options_test.go
parentd13677dad515f3e103037c70c6102410d8f3fca0 (diff)
stop parsing after end (#132)
Diffstat (limited to 'dhcpv4/options_test.go')
-rw-r--r--dhcpv4/options_test.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/dhcpv4/options_test.go b/dhcpv4/options_test.go
index 0268483..899fb2c 100644
--- a/dhcpv4/options_test.go
+++ b/dhcpv4/options_test.go
@@ -167,12 +167,9 @@ func TestOptionsFromBytes(t *testing.T) {
}
opts, err := OptionsFromBytes(options)
require.NoError(t, err)
- require.Equal(t, 5, len(opts))
+ require.Equal(t, 2, len(opts))
require.Equal(t, opts[0].(*OptionGeneric), &OptionGeneric{OptionCode: OptionNameServer, Data: []byte{192, 168, 1, 1}})
require.Equal(t, opts[1].(*OptionGeneric), &OptionGeneric{OptionCode: OptionEnd})
- require.Equal(t, opts[2].(*OptionGeneric), &OptionGeneric{OptionCode: OptionPad})
- require.Equal(t, opts[3].(*OptionGeneric), &OptionGeneric{OptionCode: OptionPad})
- require.Equal(t, opts[4].(*OptionGeneric), &OptionGeneric{OptionCode: OptionPad})
}
func TestOptionsFromBytesZeroLength(t *testing.T) {