From ff5ba169e84f2830c307e797974d4c8f7ad92caa Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Wed, 4 Mar 2015 14:04:50 +0000 Subject: [PATCH] text-formatter: do not quote 9 --- text_formatter.go | 2 +- text_formatter_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/text_formatter.go b/text_formatter.go index def60e9..2d884c0 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -110,7 +110,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 } diff --git a/text_formatter_test.go b/text_formatter_test.go index f604f1b..396bc5f 100644 --- a/text_formatter_test.go +++ b/text_formatter_test.go @@ -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")