1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-22 07:30:16 +02:00
fped/test/iprint

117 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

#!/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
2014-02-15 23:08:26 +02:00
#------------------------------------------------------------------------------
fped_dump "iprint: dump" <<EOF
%iprint 42
EOF
expect <<EOF
42
/* MACHINE-GENERATED ! */
package "_"
unit mm
%iprint 42
EOF
###############################################################################