diff options
-rw-r--r-- | dhcpv4/option_bootfile_name.go | 2 | ||||
-rw-r--r-- | dhcpv4/option_bootfile_name_test.go | 5 | ||||
-rw-r--r-- | dhcpv4/option_tftp_server_name.go | 2 | ||||
-rw-r--r-- | dhcpv4/option_tftp_server_name_test.go | 5 |
4 files changed, 12 insertions, 2 deletions
diff --git a/dhcpv4/option_bootfile_name.go b/dhcpv4/option_bootfile_name.go index 5f1020a..ca9317b 100644 --- a/dhcpv4/option_bootfile_name.go +++ b/dhcpv4/option_bootfile_name.go @@ -28,7 +28,7 @@ func (op *OptBootfileName) Length() int { } func (op *OptBootfileName) String() string { - return fmt.Sprintf("Bootfile Name -> %v", op.BootfileName) + return fmt.Sprintf("Bootfile Name -> %s", op.BootfileName) } diff --git a/dhcpv4/option_bootfile_name_test.go b/dhcpv4/option_bootfile_name_test.go index 1f66807..0c7c200 100644 --- a/dhcpv4/option_bootfile_name_test.go +++ b/dhcpv4/option_bootfile_name_test.go @@ -58,3 +58,8 @@ func TestParseOptBootfileNameShortLength(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte("linu"), opt.BootfileName) } + +func TestOptBootfileNameString(t *testing.T) { + o := OptBootfileName{BootfileName: []byte("testy test")} + require.Equal(t, "Bootfile Name -> testy test", o.String()) +} diff --git a/dhcpv4/option_tftp_server_name.go b/dhcpv4/option_tftp_server_name.go index 886208d..19dde21 100644 --- a/dhcpv4/option_tftp_server_name.go +++ b/dhcpv4/option_tftp_server_name.go @@ -28,7 +28,7 @@ func (op *OptTFTPServerName) Length() int { } func (op *OptTFTPServerName) String() string { - return fmt.Sprintf("TFTP Server Name -> %v", op.TFTPServerName) + return fmt.Sprintf("TFTP Server Name -> %s", op.TFTPServerName) } // ParseOptTFTPServerName returns a new OptTFTPServerName fomr a byte stream or error if any diff --git a/dhcpv4/option_tftp_server_name_test.go b/dhcpv4/option_tftp_server_name_test.go index caddf95..812210f 100644 --- a/dhcpv4/option_tftp_server_name_test.go +++ b/dhcpv4/option_tftp_server_name_test.go @@ -58,3 +58,8 @@ func TestParseOptTFTPServerNameShortLength(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte("linu"), opt.TFTPServerName) } + +func TestOptTFTPServerNameString(t *testing.T) { + o := OptTFTPServerName{TFTPServerName: []byte("testy test")} + require.Equal(t, "TFTP Server Name -> testy test", o.String()) +} |