MCPcopy
hub / github.com/andeya/pholcus / TestBytes2String_String2Bytes

Function TestBytes2String_String2Bytes

common/util/util_test.go:336–349  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

334}
335
336func TestBytes2String_String2Bytes(t *testing.T) {
337 orig := "hello world"
338 b := String2Bytes(orig)
339 s := Bytes2String(b)
340 if s != orig {
341 t.Errorf("roundtrip: got %q, want %q", s, orig)
342 }
343 orig2 := []byte("foo bar")
344 s2 := Bytes2String(orig2)
345 b2 := String2Bytes(s2)
346 if string(b2) != string(orig2) {
347 t.Errorf("roundtrip bytes: got %q, want %q", b2, orig2)
348 }
349}
350
351func TestKeyinsParse(t *testing.T) {
352 tests := []struct {

Callers

nothing calls this directly

Calls 2

String2BytesFunction · 0.85
Bytes2StringFunction · 0.85

Tested by

no test coverage detected