Allow space to separate date and time (#300)

Fixes #231
This commit is contained in:
Marcin Białoń
2019-09-19 19:45:53 +02:00
committed by Thomas Pelletier
parent ec312409d3
commit 095a905e04
4 changed files with 22 additions and 2 deletions
+9
View File
@@ -299,6 +299,9 @@ func TestDateRegexp(t *testing.T) {
if dateRegexp.FindString("1979-05-27T00:32:00.999999-07:00") == "" {
t.Error("nano precision lexing")
}
if dateRegexp.FindString("1979-05-27 07:32:00Z") == "" {
t.Error("space delimiter lexing")
}
}
func TestKeyEqualDate(t *testing.T) {
@@ -320,6 +323,12 @@ func TestKeyEqualDate(t *testing.T) {
{Position{1, 7}, tokenDate, "1979-05-27T00:32:00.999999-07:00"},
{Position{1, 39}, tokenEOF, ""},
})
testFlow(t, "foo = 1979-05-27 07:32:00Z", []token{
{Position{1, 1}, tokenKey, "foo"},
{Position{1, 5}, tokenEqual, "="},
{Position{1, 7}, tokenDate, "1979-05-27 07:32:00Z"},
{Position{1, 27}, tokenEOF, ""},
})
}
func TestFloatEndingWithDot(t *testing.T) {