(t *testing.T)
| 2013 | } |
| 2014 | |
| 2015 | func TestEncodeBase64_FollowedByDecodeRecoversOriginal(t *testing.T) { |
| 2016 | t.Parallel() |
| 2017 | for _, tc := range base64Cases { |
| 2018 | t.Run(tc.name, func(t *testing.T) { |
| 2019 | decoded, err := script.Echo(tc.decoded).EncodeBase64().DecodeBase64().String() |
| 2020 | if err != nil { |
| 2021 | t.Fatal(err) |
| 2022 | } |
| 2023 | if decoded != tc.decoded { |
| 2024 | t.Error("encode-decode round trip failed:", cmp.Diff(tc.decoded, decoded)) |
| 2025 | } |
| 2026 | encoded, err := script.Echo(tc.encoded).DecodeBase64().EncodeBase64().String() |
| 2027 | if err != nil { |
| 2028 | t.Fatal(err) |
| 2029 | } |
| 2030 | if encoded != tc.encoded { |
| 2031 | t.Error("decode-encode round trip failed:", cmp.Diff(tc.encoded, encoded)) |
| 2032 | } |
| 2033 | }) |
| 2034 | } |
| 2035 | } |
| 2036 | |
| 2037 | func TestDecodeBase64_CorrectlyDecodesInputToBytes(t *testing.T) { |
| 2038 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…