put/filter UT

This commit is contained in:
John Kerl 2016-09-29 08:44:40 -04:00
parent 52111d6dd3
commit 30a8dd4bdc
3 changed files with 69 additions and 2 deletions

View file

@ -34830,6 +34830,54 @@ zee wye 8 0.5985540091064224 0.976181385699006 34
hat wye 9 0.03144187646093577 0.7495507603507059 55
pan wye 10 0.5026260055412137 0.9526183602969864 89
mlr --from ./reg_test/input/abixy --opprint put func f(x) { begin {} }
mlr: begin statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint put func f(x) { end {} }
mlr: end statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint put subr s(x) { begin {} }
mlr: begin statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint put subr s(x) { end {} }
mlr: end statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint put func f(x) { func g(y) {} }
mlr: func statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint put func f(x) { subr t(y) {} }
mlr: subr statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint put subr s(x) { func g(y) {} }
mlr: func statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint put subr s(x) { subr t(y) {} }
mlr: subr statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint filter func f(x) { begin {} }; true
mlr: begin statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint filter func f(x) { end {} }; true
mlr: end statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint filter subr s(x) { begin {} }; true
mlr: begin statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint filter subr s(x) { end {} }; true
mlr: end statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint filter func f(x) { func g(y) {} }; true
mlr: func statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint filter func f(x) { subr t(y) {} }; true
mlr: subr statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint filter subr s(x) { func g(y) {} }; true
mlr: func statements are only valid at top level.
mlr --from ./reg_test/input/abixy --opprint filter subr s(x) { subr t(y) {} }; true
mlr: subr statements are only valid at top level.
================================================================
LOCALVAR SCOPE AND EXTENT

View file

@ -4883,6 +4883,27 @@ run_mlr --from $indir/abixy --opprint put '
$o = f(NR)
'
# No nesting of top-levels
mlr_expect_fail --from $indir/abixy --opprint put 'func f(x) { begin {} }'
mlr_expect_fail --from $indir/abixy --opprint put 'func f(x) { end {} }'
mlr_expect_fail --from $indir/abixy --opprint put 'subr s(x) { begin {} }'
mlr_expect_fail --from $indir/abixy --opprint put 'subr s(x) { end {} }'
mlr_expect_fail --from $indir/abixy --opprint put 'func f(x) { func g(y) {} }'
mlr_expect_fail --from $indir/abixy --opprint put 'func f(x) { subr t(y) {} }'
mlr_expect_fail --from $indir/abixy --opprint put 'subr s(x) { func g(y) {} }'
mlr_expect_fail --from $indir/abixy --opprint put 'subr s(x) { subr t(y) {} }'
mlr_expect_fail --from $indir/abixy --opprint filter 'func f(x) { begin {} }; true'
mlr_expect_fail --from $indir/abixy --opprint filter 'func f(x) { end {} }; true'
mlr_expect_fail --from $indir/abixy --opprint filter 'subr s(x) { begin {} }; true'
mlr_expect_fail --from $indir/abixy --opprint filter 'subr s(x) { end {} }; true'
mlr_expect_fail --from $indir/abixy --opprint filter 'func f(x) { func g(y) {} }; true'
mlr_expect_fail --from $indir/abixy --opprint filter 'func f(x) { subr t(y) {} }; true'
mlr_expect_fail --from $indir/abixy --opprint filter 'subr s(x) { func g(y) {} }; true'
mlr_expect_fail --from $indir/abixy --opprint filter 'subr s(x) { subr t(y) {} }; true'
# ----------------------------------------------------------------
announce LOCALVAR SCOPE AND EXTENT

View file

@ -21,8 +21,6 @@ PRE-RELEASE 4.6.0:
----------------------------------------------------------------
UT FOR 4.6.0:
* no begin/end/func/subr within func
* no begin/end/func/subr within subr
* print/printn zary
* func tee, emitfx3, print, dump.
* disallow func/subr redefines