mirror of
https://github.com/rclone/rclone.git
synced 2025-06-14 22:15:26 +02:00
encoder: add edge control characters and fix edge test generation
This commit is contained in:
committed by
Nick Craig-Wood
parent
6ba08b8612
commit
f0c2249086
@ -45,6 +45,22 @@ func TestEncodeSingleMaskEdge(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEncodeDoubleMaskEdge(t *testing.T) {
|
||||
for i, tc := range testCasesDoubleEdge {
|
||||
e := MultiEncoder(tc.mask)
|
||||
t.Run(strconv.FormatInt(int64(i), 10), func(t *testing.T) {
|
||||
got := e.Encode(tc.in)
|
||||
if got != tc.out {
|
||||
t.Errorf("Encode(%q) want %q got %q", tc.in, tc.out, got)
|
||||
}
|
||||
got2 := e.Decode(got)
|
||||
if got2 != tc.in {
|
||||
t.Errorf("Decode(%q) want %q got %q", got, tc.in, got2)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestEncodeInvalidUnicode(t *testing.T) {
|
||||
for i, tc := range []testCase{
|
||||
{
|
||||
|
Reference in New Issue
Block a user