Skip to content

Commit

Permalink
relax_column_count: backward compatibility for 1.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Apr 26, 2016
1 parent 84ea8fd commit d069063
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.coffee.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Options are documented [here](http://csv.adaltas.com/parse/).
@options.auto_parse ?= false
@options.auto_parse_date ?= false
@options.relax ?= false
@options.relax_column_count ?= false
@options.relax_column_count ?= true
@options.skip_empty_lines ?= false
@options.max_limit_on_data_read ?= 128000
# Counters
Expand Down
6 changes: 3 additions & 3 deletions test/columns.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe 'columns', ->
]
next()

it 'validate options column length on first line', (next) ->
it.skip 'validate options column length on first line', (next) ->
parse """
1,2,3
4,5,6,x
Expand All @@ -60,7 +60,7 @@ describe 'columns', ->
err.message.should.eql 'Number of columns on line 1 does not match header'
next()

it 'validate options column length on last line', (next) ->
it.skip 'validate options column length on last line', (next) ->
parse """
1,2,3,x
4,5,6,x
Expand All @@ -69,7 +69,7 @@ describe 'columns', ->
err.message.should.eql 'Number of columns on line 3 does not match header'
next()

it 'handles missing column if number of columns is inconsistent', (next) ->
it.skip 'handles missing column if number of columns is inconsistent', (next) ->
parse """
20322051544,1979,8.8017226E7,ABC,45,2000-01-01
28392898392,1974,8.8392926E7,23,2050-11-27
Expand Down
7 changes: 2 additions & 5 deletions test/relax_column_count.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ describe 'relax_column_count', ->
4,5
""", columns: ['a','b','c','d'], relax_column_count: true, (err, data) ->
data.should.eql [
"a":"1"
"b":"2"
"c":"3"
"a":"1", "b":"2", "c":"3"
,
"a":"4"
"b":"5"
"a":"4", "b":"5"
] unless err
next err

0 comments on commit d069063

Please sign in to comment.