diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-05 12:00:02 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-05 12:00:02 -0700 |
| commit | 050407a3b7f719ed6ce9367eb803bf948075e50e (patch) | |
| tree | 4edf660e513c961e6836f119359f83c1f52ebb06 /hotline/file_path_test.go | |
| parent | 4c24568a917fb84c429411f12e096a64222a1566 (diff) | |
Handle zero length comment and file paths for Nostalgia compatibility
Diffstat (limited to 'hotline/file_path_test.go')
| -rw-r--r-- | hotline/file_path_test.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/hotline/file_path_test.go b/hotline/file_path_test.go index 4c2f6db..f25941e 100644 --- a/hotline/file_path_test.go +++ b/hotline/file_path_test.go @@ -41,6 +41,17 @@ func TestFilePath_UnmarshalBinary(t *testing.T) { }, wantErr: false, }, + { + name: "handles empty data payload", + args: args{b: []byte{ + 0x00, 0x00, + }}, + want: FilePath{ + ItemCount: [2]byte{0x00, 0x00}, + Items: []FilePathItem(nil), + }, + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -78,7 +89,7 @@ func Test_readPath(t *testing.T) { 0x61, 0x61, 0x61, }, }, - want: "", + want: "", wantErr: true, }, { @@ -87,7 +98,6 @@ func Test_readPath(t *testing.T) { fileRoot: "/usr/local/var/mobius/Files", filePath: nil, fileName: []byte("foo"), - }, want: "/usr/local/var/mobius/Files/foo", }, @@ -153,4 +163,4 @@ func Test_readPath(t *testing.T) { } }) } -}
\ No newline at end of file +} |