github.com/cnboonhan/delve@v0.0.0-20230908061759-363f2388c2fb/pkg/dwarf/parseutil_test.go (about)

     1  package dwarf_test
     2  
     3  import (
     4  	"bytes"
     5  	"testing"
     6  
     7  	"github.com/go-delve/delve/pkg/dwarf"
     8  )
     9  
    10  func TestReadString(t *testing.T) {
    11  	bstr := bytes.NewBuffer([]byte{'h', 'i', 0x0, 0xFF, 0xCC})
    12  	str, _ := dwarf.ReadString(bstr)
    13  
    14  	if str != "hi" {
    15  		t.Fatalf("String was not parsed correctly %#v", str)
    16  	}
    17  }