@ -1159,6 +1159,16 @@ var PARSE_TESTS = [
errors : [ ]
errors : [ ]
}
}
} ,
} ,
{
description : "Pipe delimiter is guessed correctly when mixed with comas" ,
notes : "Guessing the delimiter should work even if there are many lines of comments at the start of the file" ,
input : 'one|two,two|three\nfour|five,five|six' ,
config : { } ,
expected : {
data : [ [ 'one' , 'two,two' , 'three' ] , [ 'four' , 'five,five' , 'six' ] ] ,
errors : [ ]
}
} ,
{
{
description : "Single quote as quote character" ,
description : "Single quote as quote character" ,
notes : "Must parse correctly when single quote is specified as a quote character" ,
notes : "Must parse correctly when single quote is specified as a quote character" ,
@ -1324,7 +1334,7 @@ var PARSE_TESTS = [
}
}
} ,
} ,
{
{
description : "Using reserved regex characters as quote characters " ,
description : "Using reserved regex character . as quote character " ,
input : '.a\na.,b\r\nc,d\r\ne,f\r\ng,h\r\ni,j' ,
input : '.a\na.,b\r\nc,d\r\ne,f\r\ng,h\r\ni,j' ,
config : { quoteChar : '.' } ,
config : { quoteChar : '.' } ,
expected : {
expected : {
@ -1339,6 +1349,22 @@ var PARSE_TESTS = [
}
}
}
}
} ,
} ,
{
description : "Using reserved regex character | as quote character" ,
input : '|a\na|,b\r\nc,d\r\ne,f\r\ng,h\r\ni,j' ,
config : { quoteChar : '|' } ,
expected : {
data : [ [ 'a\na' , 'b' ] , [ 'c' , 'd' ] , [ 'e' , 'f' ] , [ 'g' , 'h' ] , [ 'i' , 'j' ] ] ,
errors : [ ] ,
meta : {
linebreak : '\r\n' ,
delimiter : ',' ,
cursor : 27 ,
aborted : false ,
truncated : false
}
}
} ,
{
{
description : "Parsing with skipEmptyLines set to 'greedy'" ,
description : "Parsing with skipEmptyLines set to 'greedy'" ,
notes : "Must parse correctly without lines with no content" ,
notes : "Must parse correctly without lines with no content" ,