added tokenizer test for empty quotes
This commit is contained in:
		
							
								
								
									
										3
									
								
								config/testdata/quotes-empty.tok
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								config/testdata/quotes-empty.tok
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					one "" three
 | 
				
			||||||
 | 
					"" five ""
 | 
				
			||||||
 | 
					seven
 | 
				
			||||||
@ -131,10 +131,8 @@ func (t *Tokenizer) Scan() bool {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
end:
 | 
					end:
 | 
				
			||||||
	if t.err == nil || t.err == io.EOF {
 | 
						if t.err == nil || t.err == io.EOF {
 | 
				
			||||||
		if b.Len() > 0 {
 | 
					 | 
				
			||||||
		t.text = b.String()
 | 
							t.text = b.String()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return t.err == nil
 | 
						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) {
 | 
					func TestComments(t *testing.T) {
 | 
				
			||||||
	runTest(t, "comments",
 | 
						runTest(t, "comments",
 | 
				
			||||||
		`[[],["one"],[],["two"],[],["three"]]`,
 | 
							`[[],["one"],[],["two"],[],["three"]]`,
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user