Root/test/structure

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_dump "structure: empty file" <<EOF
7EOF
8expect <<EOF
9/* MACHINE-GENERATED ! */
10
11package "_"
12unit mm
13
14EOF
15
16#------------------------------------------------------------------------------
17
18fped_dump "structure: just an empty frame definition" <<EOF
19frame foo {
20}
21EOF
22expect <<EOF
23/* MACHINE-GENERATED ! */
24
25frame foo {
26}
27
28package "_"
29unit mm
30
31EOF
32
33#------------------------------------------------------------------------------
34
35fped_dump "structure: just the package name" <<EOF
36package "hello"
37EOF
38expect <<EOF
39/* MACHINE-GENERATED ! */
40
41package "hello"
42unit mm
43
44EOF
45
46#------------------------------------------------------------------------------
47
48fped_dump "structure: just the unit" <<EOF
49unit mil
50EOF
51expect <<EOF
52/* MACHINE-GENERATED ! */
53
54package "_"
55unit mil
56
57EOF
58
59#------------------------------------------------------------------------------
60
61fped_dump "structure: just one root frame item" <<EOF
62vec @(1mm, 1mm)
63EOF
64expect <<EOF
65/* MACHINE-GENERATED ! */
66
67package "_"
68unit mm
69
70__0: vec @(1mm, 1mm)
71EOF
72
73#------------------------------------------------------------------------------
74
75fped_dump "structure: frame plus measurement" <<EOF
76frame f {
77    a: vec @(0mm, 0mm)
78    b: vec @(1mm, 1mm)
79}
80frame f @
81meas f.a -> f.b
82EOF
83expect <<EOF
84/* MACHINE-GENERATED ! */
85
86frame f {
87    a: vec @(0mm, 0mm)
88    b: vec @(1mm, 1mm)
89}
90
91package "_"
92unit mm
93
94frame f @
95meas f.a -> f.b
96EOF
97
98#------------------------------------------------------------------------------
99
100fped_fail "structure: measurement in frame" <<EOF
101frame f {
102    a: vec @(0mm, 0mm)
103    b: vec @(1mm, 1mm)
104    meas f.a -> f.b
105}
106EOF
107expect <<EOF
1084: syntax error near "meas"
109EOF
110
111###############################################################################
112

Archive Download this file

Branches:
master



interactive