Root/
Source at commit 39fef16d1c4629dfad5feed05e0faaf7f91d08ca created 13 years 11 months ago. By werner, Got rid of the requirement to have a "package" directive. Fixed a grammar error found in the process. Also taught the regression test system a new trick: the path to "fped" can be passed in the environment variable FPED. E.g., FPED=fped.r5943 make test | |
---|---|
1 | #!/bin/sh |
2 | . ./Common |
3 | |
4 | ############################################################################### |
5 | |
6 | fped "tsort: total order" <<EOF |
7 | %tsort { |
8 | a b |
9 | a c |
10 | a d |
11 | b c |
12 | b d |
13 | c d |
14 | } |
15 | EOF |
16 | expect <<EOF |
17 | a |
18 | b |
19 | c |
20 | d |
21 | EOF |
22 | |
23 | #------------------------------------------------------------------------------ |
24 | |
25 | fped "tsort: partial order change (1)" <<EOF |
26 | %tsort { |
27 | a b |
28 | a c |
29 | a d |
30 | d b |
31 | } |
32 | EOF |
33 | expect <<EOF |
34 | a |
35 | c |
36 | d |
37 | b |
38 | EOF |
39 | |
40 | #------------------------------------------------------------------------------ |
41 | |
42 | fped "tsort: partial order change (2)" <<EOF |
43 | %tsort { |
44 | b c |
45 | c d |
46 | a b |
47 | } |
48 | EOF |
49 | expect <<EOF |
50 | a |
51 | b |
52 | c |
53 | d |
54 | EOF |
55 | |
56 | #------------------------------------------------------------------------------ |
57 | |
58 | fped "tsort: old order differs from resolution order" <<EOF |
59 | %tsort { |
60 | +a +b +c +d |
61 | a c |
62 | a b |
63 | a d |
64 | } |
65 | EOF |
66 | expect <<EOF |
67 | a |
68 | b |
69 | c |
70 | d |
71 | EOF |
72 | |
73 | #------------------------------------------------------------------------------ |
74 | |
75 | fped "tsort: order change due to priority" <<EOF |
76 | %tsort { |
77 | a b |
78 | a c 1 |
79 | a d |
80 | } |
81 | EOF |
82 | expect <<EOF |
83 | a |
84 | c |
85 | b |
86 | d |
87 | EOF |
88 | |
89 | #------------------------------------------------------------------------------ |
90 | |
91 | fped "tsort: priority accumulation without decay" <<EOF |
92 | %tsort { |
93 | +a +b +c +d |
94 | a b 1 |
95 | a d 1 |
96 | } |
97 | EOF |
98 | expect <<EOF |
99 | a |
100 | b |
101 | d |
102 | c |
103 | EOF |
104 | |
105 | #------------------------------------------------------------------------------ |
106 | |
107 | fped "tsort: priority accumulation with decay" <<EOF |
108 | %tsort { |
109 | +a -b +c +d |
110 | a b 1 |
111 | a d 1 |
112 | } |
113 | EOF |
114 | expect <<EOF |
115 | a |
116 | b |
117 | c |
118 | d |
119 | EOF |
120 | |
121 | #------------------------------------------------------------------------------ |
122 | |
123 | fped_fail "tsort: cycle" <<EOF |
124 | %tsort { |
125 | a b |
126 | b a |
127 | } |
128 | EOF |
129 | expect <<EOF |
130 | cycle detected in partial order |
131 | Aborted (core dumped) |
132 | EOF |
133 | |
134 | # not entirely comfortable about the "Aborted (core dumped)". It's a system |
135 | # message (from the shell) that may get mangled. Also, since few people keep |
136 | # their cores these days, "(core dumped)" shouldn't really appear. Wonder why |
137 | # it does. strace agrees that __WCOREFLAG is set ... |
138 | |
139 | ############################################################################### |
140 |
Branches:
master