123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- #!/bin/sh
- . ./Common
- ###############################################################################
- fped "iprint: loop" <<EOF
- loop x = 1, 3
- %iprint x
- EOF
- expect <<EOF
- 1
- 2
- 3
- EOF
- #------------------------------------------------------------------------------
- fped "iprint: two tables (independent)" <<EOF
- table { a } { 1 } { 2 }
- table { b } { 3 } { 4 }
- %iprint a*10+b
- EOF
- expect <<EOF
- 13
- 14
- 23
- 24
- EOF
- #------------------------------------------------------------------------------
- fped "iprint: two tables (2nd references 1st)" <<EOF
- table { a } { 1 } { 2 }
- table { b } { 3+a } { 4+a }
- %iprint a*10+b
- EOF
- expect <<EOF
- 14
- 15
- 25
- 26
- EOF
- #------------------------------------------------------------------------------
- fped "iprint: two tables (1st references 2nd)" <<EOF
- table { a } { 1+b } { 2+b }
- table { b } { 3 } { 4 }
- %iprint a*10+b
- EOF
- expect <<EOF
- 43
- 54
- 53
- 64
- EOF
- #------------------------------------------------------------------------------
- fped "iprint: inside frame (global variable)" <<EOF
- frame foo {
- %iprint n
- }
- loop n = 1, 2
- frame foo @
- EOF
- expect <<EOF
- 1
- 2
- EOF
- #------------------------------------------------------------------------------
- fped "iprint: inside frame (local variable) " <<EOF
- frame foo {
- set n1 = n+1
- %iprint n1
- }
- loop n = 1, 2
- frame foo @
- EOF
- expect <<EOF
- 2
- 3
- EOF
- #------------------------------------------------------------------------------
- fped_fail "iprint: undefined variable" <<EOF
- %iprint foo
- EOF
- expect <<EOF
- undefined variable "foo"
- EOF
- #------------------------------------------------------------------------------
- fped_dump "iprint: dump" <<EOF
- %iprint 42
- EOF
- expect <<EOF
- 42
- /* MACHINE-GENERATED ! */
- package "_"
- unit mm
- %iprint 42
- EOF
- ###############################################################################
|