annotate test/bug-45969.tst @ 28240:2fb684dc2ec2

axis.m: Implement "fill" option for Matlab compatibility. * axis.m: Document that "fill" is a synonym for "normal". Place "vis3d" option in documentation table for modes which affect aspect ratio. Add strcmpi (opt, "fill") to decode opt and executed the same behavior as "normal".
author Rik <rik@octave.org>
date Fri, 24 Apr 2020 13:16:09 -0700
parents 63b5a17ba30f
children 2838bbd84b87
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25824
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
1 %!test
26698
63b5a17ba30f Use save_default_options() to make BIST test suite robust against user configurations.
Rik <rik@octave.org>
parents: 26683
diff changeset
2 %! text_filename = tempname ();
25824
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
3 %! binary_filename = tempname ();
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
4 %! a = 2;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
5 %! b = 10;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
6 %! c = 20;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
7 %! f1 = @ (f, x) f (x) + a;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
8 %! f2 = @ (y) f1 (@ (z) z^2 + b * y, y) + c;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
9 %! f2_arg = 5;
26683
b765393dabe6 bug-45969.tst: save/restore save_default_options when doing test.
Rik <rik@octave.org>
parents: 26473
diff changeset
10 %! save_default_options ("-text", "local");
25824
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
11 %! unwind_protect
26698
63b5a17ba30f Use save_default_options() to make BIST test suite robust against user configurations.
Rik <rik@octave.org>
parents: 26683
diff changeset
12 %! save (text_filename, "f2");
25824
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
13 %! save ("-binary", binary_filename, "f2");
26698
63b5a17ba30f Use save_default_options() to make BIST test suite robust against user configurations.
Rik <rik@octave.org>
parents: 26683
diff changeset
14 %! text = load (text_filename);
25824
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
15 %! binary = load (binary_filename);
26698
63b5a17ba30f Use save_default_options() to make BIST test suite robust against user configurations.
Rik <rik@octave.org>
parents: 26683
diff changeset
16 %! assert (f2 (f2_arg), text.f2 (f2_arg));
25824
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
17 %! assert (f2 (f2_arg), binary.f2 (f2_arg));
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
18 %! unwind_protect_cleanup
26698
63b5a17ba30f Use save_default_options() to make BIST test suite robust against user configurations.
Rik <rik@octave.org>
parents: 26683
diff changeset
19 %! unlink (text_filename);
25824
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
20 %! unlink (binary_filename);
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
21 %! end_unwind_protect
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
22
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
23 %!testif HAVE_HDF5
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
24 %! hdf5_filename = tempname ();
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
25 %! a = 2;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
26 %! b = 10;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
27 %! c = 20;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
28 %! f1 = @ (f, x) f (x) + a;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
29 %! f2 = @ (y) f1 (@ (z) z^2 + b * y, y) + c;
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
30 %! f2_arg = 5;
26683
b765393dabe6 bug-45969.tst: save/restore save_default_options when doing test.
Rik <rik@octave.org>
parents: 26473
diff changeset
31 %! save_default_options ("-text", "local");
25824
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
32 %! unwind_protect
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
33 %! save ("-hdf5", hdf5_filename, "f2");
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
34 %! hdf5 = load (hdf5_filename);
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
35 %! assert (f2 (f2_arg), hdf5.f2 (f2_arg));
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
36 %! unwind_protect_cleanup
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
37 %! unlink (hdf5_filename);
91e1ca0e3a9d Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
diff changeset
38 %! end_unwind_protect