gioui.org/ui@v0.0.0-20190926171558-ce74bc0cbaea/app/internal/gl/util_test.go (about)

     1  package gl
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestGoString(t *testing.T) {
     8  	tests := [][2]string{
     9  		{"Hello\x00", "Hello"},
    10  		{"\x00", ""},
    11  	}
    12  	for _, test := range tests {
    13  		got := GoString([]byte(test[0]))
    14  		if exp := test[1]; exp != got {
    15  			t.Errorf("expected %q got %q", exp, got)
    16  		}
    17  	}
    18  }