2 * Test that variables can only be assigned to a set of allowed values
3 * and that an error is thrown if such an attempt is made.
7 * Function that tests if VAR can successfully set to each of the
8 * values in ALLOWED, but causes an error if set to INVALID.
10 * Returns a list of the assigned values and an empty list if the test
14 (test_setter(var, allowed, invalid) :=
16 append(map(lambda([v], var:: v), allowed),
17 [errcatch(var:: invalid)])),
21 test_setter('display2d_unicode, [false, true], 99);
24 test_setter('logexpand, [false, true, all], 99);
25 [false, true, all, []];
27 test_setter('loadprint, [false, true, 'loadfile, 'autoload], 99);
28 [false, true, 'loadfile, 'autoload, []];
30 test_setter('radexpand, [false, true, 'all], 99);
31 [false, true, all, []];
33 test_setter('rootsconmode, [false, true, 'all], 99);
34 [false, true, all, []];
36 test_setter('triginverses, [false, true, 'all], 99);
37 [false, true, all, []];
39 test_setter('scalarmatrixp, [false, true, 'all], 99);
40 [false, true, all, []];
42 test_setter('assumescalar, [false, true, 'all], 99);
43 [false, true, all, []];
45 test_setter('savedef, [false, true, 'all], 99);
46 [false, true, all, []];
48 test_setter('showtime, [false, true, 'all], 99);
49 [false, true, all, []];
51 test_setter('tr_warn_fexpr, ['all, 'compile, 'compfile, 'translate], 99);
52 ['all, 'compile, 'compfile, 'translate, []];
53 test_setter('tr_warn_meval, ['all, 'compile, 'compfile, 'translate], 99);
54 ['all, 'compile, 'compfile, 'translate, []];
55 test_setter('tr_warn_mode, ['all, 'compile, 'compfile, 'translate], 99);
56 ['all, 'compile, 'compfile, 'translate, []];
57 test_setter('tr_warn_undeclared, ['all, 'compile, 'compfile, 'translate], 99);
58 ['all, 'compile, 'compfile, 'translate, []];
59 test_setter('tr_warn_undefined_variable, ['all, 'compile, 'compfile, 'translate], 99);
60 ['all, 'compile, 'compfile, 'translate, []];