mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
Don't parse CSV comments (#1859)
* `mlr sort -b` feature * mlr regtest -p test/cases/cli-help && make dev * Don't parse CSV comments * Add tests for PR 1346 * Add tests for PR 1787 * Add test CSV files
This commit is contained in:
parent
369156b70d
commit
06e16ea3ee
18 changed files with 62 additions and 37 deletions
1
test/cases/io-skip-pass-comments/pr-1346/cmd
Normal file
1
test/cases/io-skip-pass-comments/pr-1346/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --skip-comments --csv --pass-comments cat test/input/pr-1346.csv
|
||||
1
test/cases/io-skip-pass-comments/pr-1346/experr
Normal file
1
test/cases/io-skip-pass-comments/pr-1346/experr
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr: mlr: CSV header/data length mismatch 2 != 1 at filename test/input/pr-1346.csv row 4.
|
||||
5
test/cases/io-skip-pass-comments/pr-1346/expout
Normal file
5
test/cases/io-skip-pass-comments/pr-1346/expout
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
field1,field2
|
||||
a,b
|
||||
# that was the first record
|
||||
c,d
|
||||
# that was the second record, and there is no more data
|
||||
0
test/cases/io-skip-pass-comments/pr-1346/should-fail
Normal file
0
test/cases/io-skip-pass-comments/pr-1346/should-fail
Normal file
1
test/cases/io-skip-pass-comments/pr-1787-a/cmd
Normal file
1
test/cases/io-skip-pass-comments/pr-1787-a/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat test/input/pr-1787.csv
|
||||
1
test/cases/io-skip-pass-comments/pr-1787-a/experr
Normal file
1
test/cases/io-skip-pass-comments/pr-1787-a/experr
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr: parse error on line 3, column 4: bare " in non-quoted-field.
|
||||
2
test/cases/io-skip-pass-comments/pr-1787-a/expout
Normal file
2
test/cases/io-skip-pass-comments/pr-1787-a/expout
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
a,b,c
|
||||
1,2,3
|
||||
0
test/cases/io-skip-pass-comments/pr-1787-a/should-fail
Normal file
0
test/cases/io-skip-pass-comments/pr-1787-a/should-fail
Normal file
1
test/cases/io-skip-pass-comments/pr-1787-b/cmd
Normal file
1
test/cases/io-skip-pass-comments/pr-1787-b/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv --pass-comments cat test/input/pr-1787.csv
|
||||
0
test/cases/io-skip-pass-comments/pr-1787-b/experr
Normal file
0
test/cases/io-skip-pass-comments/pr-1787-b/experr
Normal file
4
test/cases/io-skip-pass-comments/pr-1787-b/expout
Normal file
4
test/cases/io-skip-pass-comments/pr-1787-b/expout
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
a,b,c
|
||||
1,2,3
|
||||
# x"y
|
||||
4,5,6
|
||||
1
test/cases/io-skip-pass-comments/pr-1787-c/cmd
Normal file
1
test/cases/io-skip-pass-comments/pr-1787-c/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv --skip-comments cat test/input/pr-1787.csv
|
||||
0
test/cases/io-skip-pass-comments/pr-1787-c/experr
Normal file
0
test/cases/io-skip-pass-comments/pr-1787-c/experr
Normal file
3
test/cases/io-skip-pass-comments/pr-1787-c/expout
Normal file
3
test/cases/io-skip-pass-comments/pr-1787-c/expout
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
a,b,c
|
||||
1,2,3
|
||||
4,5,6
|
||||
6
test/input/pr-1346.csv
Normal file
6
test/input/pr-1346.csv
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
field1,field2
|
||||
a,b
|
||||
# that was the first record
|
||||
c,d
|
||||
# that was the second record, and there is no more data
|
||||
|
||||
|
4
test/input/pr-1787.csv
Normal file
4
test/input/pr-1787.csv
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
a,b,c
|
||||
1,2,3
|
||||
# x"y
|
||||
4,5,6
|
||||
|
Can't render this file because it contains an unexpected character in line 3 and column 4.
|
Loading…
Add table
Add a link
Reference in a new issue