File: rtest_setvar.mac

package info (click to toggle)
maxima 5.49.0-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 128,980 kB
  • sloc: lisp: 437,854; fortran: 14,665; tcl: 10,143; sh: 4,598; makefile: 2,204; ansic: 447; java: 374; python: 262; perl: 201; xml: 60; awk: 28; sed: 15; javascript: 2
file content (63 lines) | stat: -rw-r--r-- 1,936 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 * Test that variables can only be assigned to a set of allowed values
 * and that an error is thrown if such an attempt is made.
 */

/*
 * Function that tests if VAR can successfully set to each of the
 * values in ALLOWED, but causes an error if set to INVALID.
 *
 * Returns a list of the assigned values and an empty list if the test
 * succeeded.
 */

(test_setter(var, allowed, invalid) :=
  block([result:[]],
    append(map(lambda([v], var:: v), allowed),
           [errcatch(var:: invalid)])),
  0);
0;

test_setter('display2d_unicode, [false, true], 99);
[false, true, []];

test_setter('logexpand, [false, true, all], 99);
[false, true, all, []];

test_setter('loadprint, [false, true, 'loadfile, 'autoload], 99);
[false, true, 'loadfile, 'autoload, []];

test_setter('radexpand, [false, true, 'all], 99);
[false, true, all, []];

test_setter('rootsconmode, [false, true, 'all], 99);
[false, true, all, []];

test_setter('triginverses, [false, true, 'all], 99);
[false, true, all, []];

test_setter('scalarmatrixp, [false, true, 'all], 99);
[false, true, all, []];

test_setter('assumescalar, [false, true, 'all], 99);
[false, true, all, []];

test_setter('savedef, [false, true, 'all], 99);
[false, true, all, []];

test_setter('showtime, [false, true, 'all], 99);
[false, true, all, []];

test_setter('tr_warn_fexpr, ['all, 'compile, 'compfile, 'translate], 99);
['all, 'compile, 'compfile, 'translate, []];
test_setter('tr_warn_meval, ['all, 'compile, 'compfile, 'translate], 99);
['all, 'compile, 'compfile, 'translate, []];
test_setter('tr_warn_mode, ['all, 'compile, 'compfile, 'translate], 99);
['all, 'compile, 'compfile, 'translate, []];
test_setter('tr_warn_undeclared, ['all, 'compile, 'compfile, 'translate], 99);
['all, 'compile, 'compfile, 'translate, []];
test_setter('tr_warn_undefined_variable, ['all, 'compile, 'compfile, 'translate], 99);
['all, 'compile, 'compfile, 'translate, []];

(reset(), 0);
0;