fichier: 1fichier support - fixes #2908
This was started by Fionera, finished off by Laura with fixes and more docs from Nick. Co-authored-by: Fionera <fionera@fionera.de> Co-authored-by: Nick Craig-Wood <nick@craig-wood.com>
This commit is contained in:
parent
2d0e9885bd
commit
dde4dd0198
19 changed files with 1314 additions and 1 deletions
24
backend/fichier/replace_test.go
Normal file
24
backend/fichier/replace_test.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package fichier
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestReplace(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
in string
|
||||
out string
|
||||
}{
|
||||
{"", ""},
|
||||
{"abc 123", "abc 123"},
|
||||
{"\"'<>/\\$`", `"'<>/\$``},
|
||||
{" leading space", "␠leading space"},
|
||||
} {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue