Merge pull request #143 from henrikhodne/do-not-quote-9

Text formatter: Do not quote 9
This commit is contained in:
Simon Eskildsen 2015-03-04 10:45:58 -05:00
commit a020ac2471
2 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,7 @@ func needsQuoting(text string) bool {
for _, ch := range text {
if !((ch >= 'a' && ch <= 'z') ||
(ch >= 'A' && ch <= 'Z') ||
(ch >= '0' && ch < '9') ||
(ch >= '0' && ch <= '9') ||
ch == '-' || ch == '.') {
return false
}

View File

@ -25,6 +25,7 @@ func TestQuoting(t *testing.T) {
checkQuoting(false, "abcd")
checkQuoting(false, "v1.0")
checkQuoting(false, "1234567890")
checkQuoting(true, "/foobar")
checkQuoting(true, "x y")
checkQuoting(true, "x,y")