Skip to content

Commit

Permalink
Update insn/Reader tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elct9620 committed Feb 3, 2024
1 parent 9d49cb7 commit ad3d8c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions insn/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ func Test_Reader_String(t *testing.T) {
}
}

func Test_Reader_String_Length_Invalid(t *testing.T) {
data := []byte{0x00}
reader := insn.NewBinaryReader(bytes.NewReader(data))

_, err := reader.String()
if err == nil {
t.Errorf("Read String failed: expected error, got nil")
}
}

func Test_Reader_String_Invalid(t *testing.T) {
data := []byte{0x00, 0x03, 'a', 'b'}
reader := insn.NewBinaryReader(bytes.NewReader(data))
Expand Down

0 comments on commit ad3d8c1

Please sign in to comment.