c/reg_test: make subprocess test libc-agnostic

A test in c/reg_test/run currently relies on glibc-specific
print buffering behavior in a test case that checks environment
vars with subprocesses.

The case in question made mlr spawn a script that prints a few lines
but also had mlr print lines itself at the same time. The order of
lines from mlr vs subprocess are undefined, producing a slightly
different outcome on Alpine Linux than on Glibc-based distributions.

This commit adds the "put -q" flag to the test case effectively
causing only the subprocess output to be printed (which is the one
the particular test case was interested in).

Relates to https://github.com/johnkerl/miller/issues/293
This commit is contained in:
Richard Patel 2020-08-24 22:14:38 +02:00
parent 640af6eb1c
commit 39cd68dd29
No known key found for this signature in database
GPG key ID: 77A6A8A1CF8D1762
2 changed files with 1 additions and 11 deletions

View file

@ -18661,16 +18661,6 @@ mlr --from ./reg_test/input/abixy put ENV["ZYX"]="CBA".NR; print | ENV["indir"].
[ZYX]=[CBA1] a is zee
[ZYX]=[CBA1] a is hat
[ZYX]=[CBA1] a is pan
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864
================================================================

View file

@ -1308,7 +1308,7 @@ echo 'x=' | run_mlr put '$y = capitalize($x)'
echo 'x=hello' | run_mlr put '$y = capitalize($z)'
mention LHS value on first record should result in ZYX for process creation
export indir; run_mlr --from $indir/abixy put 'ENV["ZYX"]="CBA".NR; print | ENV["indir"]."/env-assign.sh" , "a is " . $a'
export indir; run_mlr --from $indir/abixy put -q 'ENV["ZYX"]="CBA".NR; print | ENV["indir"]."/env-assign.sh" , "a is " . $a'
# ----------------------------------------------------------------
announce POSITIONAL INDEXING