MCPcopy
hub / github.com/rclone/rclone / TestEncodeDot

Function TestEncodeDot

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

Source from the content-addressed store, hash-verified

176}
177
178func TestEncodeDot(t *testing.T) {
179 for i, tc := range []testCase{
180 {
181 mask: EncodeZero,
182 in: ".",
183 out: ".",
184 }, {
185 mask: EncodeDot,
186 in: ".",
187 out: ".",
188 }, {
189 mask: EncodeZero,
190 in: "..",
191 out: "..",
192 }, {
193 mask: EncodeDot,
194 in: "..",
195 out: "..",
196 }, {
197 mask: EncodeDot,
198 in: "...",
199 out: "...",
200 }, {
201 mask: EncodeDot,
202 in: ". .",
203 out: ". .",
204 },
205 } {
206 e := tc.mask
207 t.Run(strconv.FormatInt(int64(i), 10), func(t *testing.T) {
208 got := e.Encode(tc.in)
209 if got != tc.out {
210 t.Errorf("Encode(%q) want %q got %q", tc.in, tc.out, got)
211 }
212 got2 := e.Decode(got)
213 if got2 != tc.in {
214 t.Errorf("Decode(%q) want %q got %q", got, tc.in, got2)
215 }
216 })
217 }
218}
219
220func TestDecodeHalf(t *testing.T) {
221 for i, tc := range []testCase{

Callers

nothing calls this directly

Calls 4

RunMethod · 0.65
EncodeMethod · 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…