MCPcopy
hub / github.com/bitfield/script / TestDecodeBase64_CorrectlyDecodesInputToBytes

Function TestDecodeBase64_CorrectlyDecodesInputToBytes

script_test.go:2037–2049  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2035}
2036
2037func TestDecodeBase64_CorrectlyDecodesInputToBytes(t *testing.T) {
2038 t.Parallel()
2039 input := "CAAAEA=="
2040 got, err := script.Echo(input).DecodeBase64().Bytes()
2041 if err != nil {
2042 t.Fatal(err)
2043 }
2044 want := []byte{8, 0, 0, 16}
2045 if !bytes.Equal(want, got) {
2046 t.Logf("input %#v incorrectly decoded:", input)
2047 t.Error(cmp.Diff(want, got))
2048 }
2049}
2050
2051func TestEncodeBase64_CorrectlyEncodesInputBytes(t *testing.T) {
2052 t.Parallel()

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
BytesMethod · 0.80
DecodeBase64Method · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…