mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 18:25:45 +00:00
Move some more cases to regtest v2 (#472)
This commit is contained in:
parent
804a1d85cc
commit
ebe47bc5ed
107 changed files with 269 additions and 349 deletions
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0001.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0001.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/simple.csv-crlf
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
a,b,c
|
||||
1,x,3
|
||||
4,5,6
|
||||
x,"y""yy",z
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0002.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0002.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/simple-truncated.csv
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
a,b,c
|
||||
1,x,3
|
||||
4,5,6
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0003.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0003.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/narrow.csv
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0004.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0004.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/narrow-truncated.csv
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0005.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0005.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/quoted-comma.csv
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
a,b,c
|
||||
1,"x,3",y
|
||||
4,5,6
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0006.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0006.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/quoted-comma-truncated.csv
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
a,b,c
|
||||
1,"x,3",y
|
||||
4,5,6
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0007.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0007.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/quoted-crlf.csv
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
a,b,c
|
||||
1,"x
|
||||
3",y
|
||||
4,5,6
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0008.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0008.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/quoted-crlf-truncated.csv
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
a,b,c
|
||||
1,"x
|
||||
3",y
|
||||
4,5,6
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0009.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0009.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv cat reg-test/input/rfc-csv/simple-truncated.csv reg-test/input/rfc-csv/simple.csv-crlf
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
a,b,c
|
||||
1,x,3
|
||||
4,5,6
|
||||
1,x,3
|
||||
4,5,6
|
||||
x,"y""yy",z
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0010.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0010.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv --ifs semicolon --ofs pipe --irs lf --ors lflf cut -x -f b reg-test/input/rfc-csv/modify-defaults.csv
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
a|c
|
||||
|
||||
1|3
|
||||
|
||||
4|6
|
||||
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0011.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0011.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv --rs lf --quote-original cut -o -f c,b,a reg-test/input/quote-original.csv
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
c,b,a
|
||||
3,2,1
|
||||
6,"5",4
|
||||
"9",8,"7"
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0012.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0012.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --icsv --oxtab cat reg-test/input/comma-at-eof.csv
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
a 1
|
||||
b 2
|
||||
c 3
|
||||
|
||||
a 4
|
||||
b 5
|
||||
c
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0013.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0013.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv --quote-all cat reg-test/input/rfc-csv/simple.csv-crlf
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
"a","b","c"
|
||||
"1","x","3"
|
||||
"4","5","6"
|
||||
"x","y""yy","z"
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0014.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0014.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --csv --quote-original cat reg-test/input/rfc-csv/simple.csv-crlf
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
a,b,c
|
||||
1,x,3
|
||||
4,5,6
|
||||
"x","y""yy","z"
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0015.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0015.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --itsv --rs lf --oxtab cat reg-test/input/simple.tsv
|
||||
29
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0015.expout
Normal file
29
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0015.expout
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
a pan
|
||||
b pan
|
||||
i 1
|
||||
x 2
|
||||
y 0.989945
|
||||
|
||||
a eks
|
||||
b pan
|
||||
i 2
|
||||
x 1
|
||||
y 0.775159
|
||||
|
||||
a wye
|
||||
b wye
|
||||
i 3
|
||||
x 1
|
||||
y 0.761642
|
||||
|
||||
a eks
|
||||
b wye
|
||||
i 4
|
||||
x 5
|
||||
y 0.322934
|
||||
|
||||
a wye
|
||||
b pan
|
||||
i 5
|
||||
x 5
|
||||
y 0.448283
|
||||
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0016.cmd
Normal file
1
go/reg-test/cases-pending-go-port/c-io-rfc-csv/0016.cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --iusv --oxtab cat reg-test/input/example.usv
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
a d
|
||||
b e
|
||||
c f
|
||||
|
||||
a g
|
||||
b h
|
||||
c i
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/abixy-het put '$length = length($a)'
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,length=1
|
||||
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,length=1
|
||||
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,length=1
|
||||
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,length=1
|
||||
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,length=1
|
||||
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,length=1
|
||||
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,length=1
|
||||
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,length=1
|
||||
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,length=1
|
||||
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,length=1
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/abixy-het put '$length = length($*)'
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,length=5
|
||||
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,length=5
|
||||
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,length=5
|
||||
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,length=5
|
||||
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,length=5
|
||||
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,length=5
|
||||
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,length=5
|
||||
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,length=5
|
||||
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,length=5
|
||||
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,length=5
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put '$length= length({3:4, 5:{6:7}, 8:{9:{10:11}}})'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,length=3
|
||||
x=6,y=7,u=8,length=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put 'o = {3:4, 5:{6:7}, 8:{9:{10:11}}}; $length = length(o)'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,length=3
|
||||
x=6,y=7,u=8,length=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put '@o = {3:4, 5:{6:7}, 8:{9:{10:11}}}; $length = length(@o)'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,length=3
|
||||
x=6,y=7,u=8,length=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/abixy-het put '$depth = depth($a)'
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,depth=0
|
||||
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,depth=0
|
||||
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,depth=0
|
||||
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,depth=0
|
||||
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,depth=0
|
||||
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,depth=0
|
||||
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,depth=0
|
||||
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,depth=0
|
||||
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,depth=0
|
||||
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,depth=0
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/abixy-het put '$depth = depth($*)'
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,depth=1
|
||||
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,depth=1
|
||||
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,depth=1
|
||||
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,depth=1
|
||||
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,depth=1
|
||||
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,depth=1
|
||||
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,depth=1
|
||||
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,depth=1
|
||||
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,depth=1
|
||||
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,depth=1
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put '$depth= depth({3:4, 5:{6:7}, 8:{9:{10:11}}})'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,depth=3
|
||||
x=6,y=7,u=8,depth=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put 'o = {3:4, 5:{6:7}, 8:{9:{10:11}}}; $depth = depth(o)'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,depth=3
|
||||
x=6,y=7,u=8,depth=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put '@o = {3:4, 5:{6:7}, 8:{9:{10:11}}}; $depth = depth(@o)'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,depth=3
|
||||
x=6,y=7,u=8,depth=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/abixy-het put '$leafcount = leafcount($a)'
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,leafcount=1
|
||||
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,leafcount=1
|
||||
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,leafcount=1
|
||||
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,leafcount=1
|
||||
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,leafcount=1
|
||||
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,leafcount=1
|
||||
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,leafcount=1
|
||||
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,leafcount=1
|
||||
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,leafcount=1
|
||||
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,leafcount=1
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/abixy-het put '$leafcount = leafcount($*)'
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,leafcount=5
|
||||
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,leafcount=5
|
||||
aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,leafcount=5
|
||||
a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,leafcount=5
|
||||
a=wye,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729,leafcount=5
|
||||
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697,leafcount=5
|
||||
a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694,leafcount=5
|
||||
a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006,leafcount=5
|
||||
aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059,leafcount=5
|
||||
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864,leafcount=5
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put '$leafcount= leafcount({3:4, 5:{6:7}, 8:{9:{10:11}}})'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,leafcount=3
|
||||
x=6,y=7,u=8,leafcount=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put 'o = {3:4, 5:{6:7}, 8:{9:{10:11}}}; $leafcount = leafcount(o)'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,leafcount=3
|
||||
x=6,y=7,u=8,leafcount=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/xyz2 put '@o = {3:4, 5:{6:7}, 8:{9:{10:11}}}; $leafcount = leafcount(@o)'
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
x=3,y=4,z=5,leafcount=3
|
||||
x=6,y=7,u=8,leafcount=3
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/abixy-het put -q 'dump {"a"."b":$a.$b}'
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"ab": "panpan"
|
||||
}
|
||||
{
|
||||
"ab": "ekspan"
|
||||
}
|
||||
{
|
||||
"ab": "wye"
|
||||
}
|
||||
{
|
||||
"ab": "eks"
|
||||
}
|
||||
{
|
||||
"ab": "wyepan"
|
||||
}
|
||||
{
|
||||
"ab": "zeepan"
|
||||
}
|
||||
{
|
||||
"ab": "ekszee"
|
||||
}
|
||||
{
|
||||
"ab": "zeewye"
|
||||
}
|
||||
{
|
||||
"ab":
|
||||
}
|
||||
{
|
||||
"ab": "panwye"
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
mlr --from reg-test/input/abixy-het put -q 'func f(a, b) { return {"a"."b":a.b} } dump f($a, $b)'
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"ab": "panpan"
|
||||
}
|
||||
{
|
||||
"ab": "ekspan"
|
||||
}
|
||||
{
|
||||
"ab": "wye"
|
||||
}
|
||||
{
|
||||
"ab": "eks"
|
||||
}
|
||||
{
|
||||
"ab": "wyepan"
|
||||
}
|
||||
{
|
||||
"ab": "zeepan"
|
||||
}
|
||||
{
|
||||
"ab": "ekszee"
|
||||
}
|
||||
{
|
||||
"ab": "zeewye"
|
||||
}
|
||||
{
|
||||
"ab":
|
||||
}
|
||||
{
|
||||
"ab": "panwye"
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
run_mlr --csv cat $indir/rfc-csv/simple.csv-crlf
|
||||
run_mlr --csv cat $indir/rfc-csv/simple-truncated.csv
|
||||
run_mlr --csv cat $indir/rfc-csv/narrow.csv
|
||||
run_mlr --csv cat $indir/rfc-csv/narrow-truncated.csv
|
||||
run_mlr --csv cat $indir/rfc-csv/quoted-comma.csv
|
||||
run_mlr --csv cat $indir/rfc-csv/quoted-comma-truncated.csv
|
||||
run_mlr --csv cat $indir/rfc-csv/quoted-crlf.csv
|
||||
run_mlr --csv cat $indir/rfc-csv/quoted-crlf-truncated.csv
|
||||
run_mlr --csv cat $indir/rfc-csv/simple-truncated.csv $indir/rfc-csv/simple.csv-crlf
|
||||
run_mlr --csv --ifs semicolon --ofs pipe --irs lf --ors lflf cut -x -f b $indir/rfc-csv/modify-defaults.csv
|
||||
run_mlr --csv --rs lf --quote-original cut -o -f c,b,a $indir/quote-original.csv
|
||||
|
||||
run_mlr --icsv --oxtab cat $indir/comma-at-eof.csv
|
||||
|
||||
run_mlr --csv --quote-all cat $indir/rfc-csv/simple.csv-crlf
|
||||
run_mlr --csv --quote-original cat $indir/rfc-csv/simple.csv-crlf
|
||||
|
||||
run_mlr --itsv --rs lf --oxtab cat $indir/simple.tsv
|
||||
|
||||
run_mlr --iusv --oxtab cat $indir/example.usv
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue