MCPcopy Create free account
hub / github.com/chain/txvm / TestEncode

Function TestEncode

cmd/hex/main_test.go:24–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestEncode(t *testing.T) {
25 in := "\xab\xcd"
26
27 got, err := ioutil.ReadAll(&encodeReader{strings.NewReader(in)})
28 if err != nil {
29 t.Fatal(err)
30 }
31
32 want := []byte("abcd")
33 if !bytes.Equal(got, want) {
34 t.Errorf("encodeReader(%q) = %q want %q", in, got, want)
35 }
36}
37
38func TestDecode(t *testing.T) {
39 in := "abcd"

Callers

nothing calls this directly

Calls 1

EqualMethod · 0.80

Tested by

no test coverage detected