1 /* Tests for Maxima's trace and timer */
7 /* Bug #3247: Maxima's trace and timer handle rules incorrectly */
10 defrule (r, foo, bar),
15 trace_options (r, noprint),
19 /* This used to return foo */
29 /* This also used to return foo */
38 /* Bug #2803: trace/timer do not work for functions with quoted arguments
40 * Here we test some traced and timed functions that have different
41 * combinations of quoted and rest args. The timer tests are actually
42 * redundant since trace and timer didn't require separate fixes.
45 /* Watch out for extra evaluations */
46 ([a, b, c, d] : [u, v, w, x],
47 [u, v, w, x] : [1, 2, 3, 4],
56 trace_options (f1, noprint),
89 trace_options (f2, noprint),
99 f2 (error (), error (), error (), error ());
100 ['(error ()), '(error ()), '(error ()), '(error ())];
116 f2 (error (), error (), error (), error ());
117 ['(error ()), '(error ()), '(error ()), '(error ())];
123 (f3 ('x, y, z) := [x, y, z],
128 trace_options (f3, noprint),
136 ['(error ()), 'v, 'w];
150 ['(error ()), 'v, 'w];
156 (f4 ('x, y, [z]) := [x, y, z],
161 trace_options (f4, noprint),
171 f4 (error (), b, c, d);
172 ['(error ()), 'v, ['w, 'x]];
188 f4 (error (), b, c, d);
189 ['(error ()), 'v, ['w, 'x]];
195 (f5 (x, 'y, [z]) := [x, y, z],
200 trace_options (f5, noprint),
210 f5 (a, error (), c, d);
211 ['u, '(error ()), ['w, 'x]];
227 f5 (a, error (), c, d);
228 ['u, '(error ()), ['w, 'x]];
234 (f6 (x, y, ['z]) := [x, y, z],
239 trace_options (f6, noprint),
249 f6 (a, b, error (), error ());
250 ['u, 'v, ['(error ()), '(error ())]];
266 f6 (a, b, error (), error ());
267 ['u, 'v, ['(error ()), '(error ())]];
273 (f7 ('x, 'y, ['z]) := [x, y, z],
278 trace_options (f7, noprint),
288 f7 (error (), error (), error (), error ());
289 ['(error ()), '(error ()), ['(error ()), '(error ())]];
305 f7 (error (), error (), error (), error ());
306 ['(error ()), '(error ()), ['(error ()), '(error ())]];
312 (kill (a, b, c, d, u, v, w, x),