Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit 0cbd647

Browse files
committed
bom: test behavior with the column option see #284
1 parent c980b5f commit 0cbd647

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
## Trunk
1414

15+
* bom: test behavior with the column option
1516
* src: cache length in loops
1617

1718
## Version 4.8.8

test/option.bom.coffee

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,26 @@ describe 'Option `bom`', ->
3333
parser.write Buffer.from 'd,e,f'
3434
parser.end()
3535

36+
it 'with column option with bom `true`', (next) ->
37+
parser = parse
38+
columns: true
39+
bom: true
40+
, (err, records) ->
41+
records[0]['key'].should.eql 'value'
42+
next()
43+
parser.write Buffer.from "\ufeffkey\nvalue"
44+
parser.end()
45+
46+
it 'with column option with bom `false`', (next) ->
47+
parser = parse
48+
columns: true
49+
bom: false
50+
, (err, records) ->
51+
records[0]['\ufeffkey'].should.eql 'value'
52+
next()
53+
parser.write Buffer.from "\ufeffkey\nvalue"
54+
parser.end()
55+
3656
it 'throw parsing error if quote follow bom', (next) ->
3757
parser = parse (err, data) ->
3858
assert_error err,

0 commit comments

Comments
 (0)