Root/test/um

Source at commit 103933acf59927d84df7f99d9580dfc0f45059c2 created 3 years 6 months ago.
By Werner Almesberger, fix a few whitespace issues in previous commit
1#!/bin/sh
2. ./Common
3
4###############################################################################
5
6fped "um: iprint micrometers" <<EOF
7%iprint 100um
8EOF
9expect <<EOF
10100um
11EOF
12
13#------------------------------------------------------------------------------
14
15fped "um: add mm + um" <<EOF
16%iprint 1mm + 100 um
17EOF
18expect <<EOF
191.1mm
20EOF
21
22#------------------------------------------------------------------------------
23
24fped "um: subtract mil - um" <<EOF
25%iprint 100mil - 100 um
26EOF
27expect <<EOF
282.44mm
29EOF
30
31#------------------------------------------------------------------------------
32
33fped "um: multiply um with um" <<EOF
34%iprint 100um * 50um
35EOF
36expect <<EOF
375000um^2
38EOF
39
40#------------------------------------------------------------------------------
41
42fped "um: multiply um with mm" <<EOF
43%iprint 100um * 2mm
44EOF
45expect <<EOF
460.2mm^2
47EOF
48
49#------------------------------------------------------------------------------
50
51fped "um: divide mil by um" <<EOF
52%iprint 20mil / 10um
53EOF
54expect <<EOF
5550.8
56EOF
57
58#------------------------------------------------------------------------------
59
60fped_dump "um: use um in vector" <<EOF
61vec @(100um, 50um)
62EOF
63expect <<EOF
64/* MACHINE-GENERATED ! */
65
66package "_"
67unit mm
68
69__0: vec @(100um, 50um)
70EOF
71
72#------------------------------------------------------------------------------
73
74fped "um: measure distance in um" <<EOF
75a: vec @(0mm, 0mm)
76b: vec .(300um, 0mm)
77c: vec .(0mm, 400um)
78meas a >> c /* dummy */
79m: meas a >> c
80
81%meas m
82EOF
83expect <<EOF
840.5
85EOF
86

Archive Download this file

Branches:
master



interactive