1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-15 15:53:41 +00:00

New backend for Citrix Sharefile - Fixes #1543

Many thanks to Bob Droog for organizing a test account and extensive
testing.
This commit is contained in:
Nick Craig-Wood
2019-08-27 22:50:07 +01:00
parent 1e7144eb63
commit 4627ac5709
18 changed files with 2537 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
package sharefile
import "testing"
func TestReplace(t *testing.T) {
for _, test := range []struct {
in string
out string
}{
{"", ""},
{"abc 123", "abc 123"},
{`\*<>?:|#%".~`, `#%.~`},
{`\*<>?:|#%".~/\*<>?:|#%".~`, `#%.~/#%.~`},
{" leading space", "␠leading space"},
{"trailing space ", "trailing space␠"},
{".leading dot", "leading dot"},
{"trailing dot.", "trailing dot"},
{" leading space/ leading space/ leading space", "␠leading space/␠leading space/␠leading space"},
{"trailing dot./trailing dot./trailing dot.", "trailing dot/trailing dot/trailing dot"},
{".leading dot/..leading dot/.leading dot", "leading dot/.leading dot/leading dot"},
} {
got := replaceReservedChars(test.in)
if got != test.out {
t.Errorf("replaceReservedChars(%q) want %q got %q", test.in, test.out, got)
}
got2 := restoreReservedChars(got)
if got2 != test.in {
t.Errorf("restoreReservedChars(%q) want %q got %q", got, test.in, got2)
}
}
}