added tokenizer test for empty quotes
This commit is contained in:
1 parent
cd73181a62
commit
814102fc09
3 files changed
+10
-3
No files matched your search
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
one "" three
|
||||
"" five ""
|
||||
seven
|
||||
+1
-3
@@ -131,9 +131,7 @@ func (t *Tokenizer) Scan() bool {
|
||||
|
||||
end:
|
||||
if t.err == nil || t.err == io.EOF {
|
||||
if b.Len() > 0 {
|
||||
t.text = b.String()
|
||||
}
|
||||
t.text = b.String()
|
||||
}
|
||||
return t.err == nil
|
||||
}
|
||||
|
||||
@@ -29,6 +29,12 @@ func TestQuotesMultiline(t *testing.T) {
|
||||
)
|
||||
}
|
||||
|
||||
func TestQuotesEmpty(t *testing.T) {
|
||||
runTest(t, "quotes-empty",
|
||||
`[["one","","three"],["","five",""],["seven"]]`,
|
||||
)
|
||||
}
|
||||
|
||||
func TestComments(t *testing.T) {
|
||||
runTest(t, "comments",
|
||||
`[[],["one"],[],["two"],[],["three"]]`,
|
||||
|
||||
Reference in new issue
Block a user