1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-22 01:36:14 +02:00
fped/test/um
2016-12-31 17:46:39 -03:00

86 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
. ./Common
###############################################################################
fped "um: iprint micrometers" <<EOF
%iprint 100um
EOF
expect <<EOF
100um
EOF
#------------------------------------------------------------------------------
fped "um: add mm + um" <<EOF
%iprint 1mm + 100 um
EOF
expect <<EOF
1.1mm
EOF
#------------------------------------------------------------------------------
fped "um: subtract mil - um" <<EOF
%iprint 100mil - 100 um
EOF
expect <<EOF
2.44mm
EOF
#------------------------------------------------------------------------------
fped "um: multiply um with um" <<EOF
%iprint 100um * 50um
EOF
expect <<EOF
5000um^2
EOF
#------------------------------------------------------------------------------
fped "um: multiply um with mm" <<EOF
%iprint 100um * 2mm
EOF
expect <<EOF
0.2mm^2
EOF
#------------------------------------------------------------------------------
fped "um: divide mil by um" <<EOF
%iprint 20mil / 10um
EOF
expect <<EOF
50.8
EOF
#------------------------------------------------------------------------------
fped_dump "um: use um in vector" <<EOF
vec @(100um, 50um)
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
package "_"
unit mm
__0: vec @(100um, 50um)
EOF
#------------------------------------------------------------------------------
fped "um: measure distance in um" <<EOF
a: vec @(0mm, 0mm)
b: vec .(300um, 0mm)
c: vec .(0mm, 400um)
meas a >> c /* dummy */
m: meas a >> c
%meas m
EOF
expect <<EOF
0.5
EOF