Initial euclide.org release
This commit is contained in:
19
utils_test.go
Normal file
19
utils_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAddQuotes(t *testing.T) {
|
||||
for s, wanted := range map[string]string{
|
||||
"toto": "\"toto\"",
|
||||
"\"titi": "\"titi\"",
|
||||
"\"tutu\"": "\"tutu\"",
|
||||
"te\"te": "\"te\\\"te\"",
|
||||
"\"\"ta\"ta": "\"ta\\\"ta\"",
|
||||
} {
|
||||
if res := addQuotes(s); res != wanted {
|
||||
t.Errorf("%s quoted as %s and not %s", s, res, wanted)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user