diff options
Diffstat (limited to 'tcllib/modules/pt/tests/pt_peg_interp.tests')
-rw-r--r-- | tcllib/modules/pt/tests/pt_peg_interp.tests | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tcllib/modules/pt/tests/pt_peg_interp.tests b/tcllib/modules/pt/tests/pt_peg_interp.tests new file mode 100644 index 0000000..b71c763 --- /dev/null +++ b/tcllib/modules/pt/tests/pt_peg_interp.tests @@ -0,0 +1,43 @@ +# -*- tcl -*- +# General set of error cases regarding the number of arguments. + +# ------------------------------------------------------------------------- + +# Testing the processing of PEG input in various forms, using the PEG +# interpreter to handle the grammar. + +foreach {k section} { + 0 {} + 1 -fused + 2 -templated + 3 -templated-fused +} { + TestFilesProcess $mytestdir ok peg_peg$section peg_peg-ast$section -> n label input data expected { + test pt-peg-interp-rde:${rdeimpl}-stack:${stackimpl}-2.$k.$n "pt::peg::interp /text, $label$section, ok :- $input" -setup { + set g [pt::peg::container::peg] + set p [pt::peg::interp] + $p use $g + } -body { + pt::ast print [$p parset $data] + } -cleanup { + $g destroy + $p destroy + } -result $expected + + test pt-peg-interp-rde:${rdeimpl}-stack:${stackimpl}-3.$k.$n "pt::peg::interp /file, $label$section, ok :- $input" -setup { + set g [pt::peg::container::peg] + set p [pt::peg::interp] + $p use $g + set chan [open $input] + } -body { + pt::ast print [$p parse $chan] + } -cleanup { + close $chan + $g destroy + $p destroy + } -result $expected + } +} + +#---------------------------------------------------------------------- +unset n label input data expected |