mapvar retval UT

This commit is contained in:
John Kerl 2016-11-28 20:49:44 -05:00
parent 2ddb31699c
commit f150b3b8f7
2 changed files with 60 additions and 0 deletions

View file

@ -46535,3 +46535,59 @@ a=hat,b=wye,i=9,x=0.03144187646093577,y=45
}
a=pan,b=wye,i=10,x=0.5026260055412137,y=55
mlr --from ./reg_test/input/abixy-het put func f(x) {return {"a":x,"b":x**2}}; map o = f($x); $* = o
a=0.346790,b=0.120263
a=0.758680,b=0.575595
a=0.204603,b=0.041863
a=0.381399,b=0.145465
a=,b=
a=0.527126,b=0.277862
a=0.611784,b=0.374280
a=0.598554,b=0.358267
a=0.031442,b=0.000989
a=0.502626,b=0.252633
mlr --from ./reg_test/input/abixy-het put -q func f(x) {return x**2}; var z = f($x); dump z
0.120263
0.575595
0.041863
0.145465
0.277862
0.374280
0.358267
0.000989
0.252633
mlr --from ./reg_test/input/abixy-het put -q func f(x) {map m = {NR:x};return m}; z = f($y); dump z
{
"1": 0.726803
}
{
"2": 0.522151
}
{
"3": 0.338319
}
{
"4": 0.134189
}
{
"5": 0.863624
}
{
"6": 0.493221
}
{
"7": 0.187885
}
{
"8":
}
{
"9": 0.749551
}
{
"10": 0.952618
}

View file

@ -5488,6 +5488,10 @@ run_mlr --from $indir/abixy put '
$y = @sum;
'
run_mlr --from $indir/abixy-het put 'func f(x) {return {"a":x,"b":x**2}}; map o = f($x); $* = o'
run_mlr --from $indir/abixy-het put -q 'func f(x) {return x**2}; var z = f($x); dump z'
run_mlr --from $indir/abixy-het put -q 'func f(x) {map m = {NR:x};return m}; z = f($y); dump z'
# ================================================================
# A key feature of this regression script is that it can be invoked from any
# directory. Depending on the directory it's invoked from, the path to $outdir