MCPcopy
hub / github.com/rclone/rclone / TestDecodeHalf

Function TestDecodeHalf

lib/encoder/encoder_test.go:220–256  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

218}
219
220func TestDecodeHalf(t *testing.T) {
221 for i, tc := range []testCase{
222 {
223 mask: 0,
224 in: "‛",
225 out: "‛",
226 }, {
227 mask: EncodeZero,
228 in: "‛‛",
229 out: "‛",
230 }, {
231 mask: 0,
232 in: "‛a‛",
233 out: "‛a‛",
234 }, {
235 mask: EncodeInvalidUtf8,
236 in: "a‛B‛Eg",
237 out: "a‛B‛Eg",
238 }, {
239 mask: EncodeInvalidUtf8,
240 in: "a‛B\‛Eg",
241 out: "a‛B\‛Eg",
242 }, {
243 mask: EncodeInvalidUtf8 | EncodeBackSlash,
244 in: "a‛B\‛Eg",
245 out: "a‛B\\‛Eg",
246 },
247 } {
248 e := tc.mask
249 t.Run(strconv.FormatInt(int64(i), 10), func(t *testing.T) {
250 got := e.Decode(tc.in)
251 if got != tc.out {
252 t.Errorf("Decode(%q) want %q got %q", tc.in, tc.out, got)
253 }
254 })
255 }
256}
257
258const oneDrive = (Standard |
259 EncodeWin |

Callers

nothing calls this directly

Calls 3

RunMethod · 0.65
DecodeMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…