/usr/share/octave/packages/symbolic-2.6.0/misc.tst is in octave-symbolic 2.6.0-3build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | %% Copyright (C) 2014, 2016-2017 Colin B. Macdonald
%% Copyright (C) 2016 Lagu
%%
%% This file is part of OctSymPy.
%%
%% OctSymPy is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published
%% by the Free Software Foundation; either version 3 of the License,
%% or (at your option) any later version.
%%
%% This software is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty
%% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
%% the GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public
%% License along with this software; see the file COPYING.
%% If not, see <http://www.gnu.org/licenses/>.
%% some new tests, may want to put elsewhere...
%!shared x
%! syms x
%!assert (isequal (x(1), x));
%!assert (isequal (x(end), x));
%!error <subscript.*either.*integers> x(0)
%!error <subscript.*either.*integers> x(-1)
%!error <index out of range> x(end+1)
%!error <index out of range> x(42, 42)
%!error <index out of range> x(1, 42)
%!error <index out of range> x(42, 1)
%!assert (isequal (x(1, 1), x));
%!assert (isequal (x(:, :), x));
%!assert (isequal (x(:), x));
%!error <invalid ind> x('::')
%!error <invalid ind> x(1, '::')
%!shared a
%! syms x
%! a = [1 2 x];
%!error <index out of range> a(42, 42)
%!error <index out of range> a(0, 1)
%!error <index out of range> a(1, 0)
%!shared x
%! syms x
%!error x([1 2; 1 1])
%!error <index out of range> x([1 2])
%!test
%! % matrix index into matrix
%! m = [1 x; 3 6*x];
%! assert (isequal (m([4 1; 3 3]), [6*x 1; x x]))
%!test
%! % vector index into matrix, orientation, prompted by issue #114
%! m = [0 x; 2*x 3];
%! assert (isequal (m([2; 1; 3]), [2*x; 0; x]))
%! assert (isequal (m([2 1 3]), [2*x 0 x]))
%!test
%! % matrix index into vector (scalar), issue #113
%! assert (isequal (x([1 1; 1 1]), [x x; x x]))
%! assert (isequal (x([1 1]), [x x]))
%! assert (isequal (x([1; 1]), [x; x]))
%!test
%! % matrix index into vector (scalar), issue #113
%! a = [1 x 3];
%! assert (isequal (a([1 2; 2 3]), [1 x; x 3]))
%! % but vec into vec takes orientation from a
%! assert (isequal (a([2 3]), [x 3]))
%! assert (isequal (a([2; 2]), [x x]))
%!test
%! % matrix index into vector
%! a = [10 20 x];
%! assert (isequal (a([3 1; 3 2]), [x 10; x 20]))
%!test
%! % empty indexing
%! assert (isempty (x([])))
%! assert (isequal (size(x([])), [0 0]))
%! m = [0 x 1; 2*x 3 0];
%! assert (isequal (size(m([])), [0 0]))
%! assert (isequal (size(m([],[])), [0 0]))
%! assert (isequal (size(m(:,[])), [2 0]))
%! assert (isequal (size(m([],:)), [0 3]))
%!shared
%!test
%! r = python_cmd ('return Version("0.7.6") > Version("0.7.6"),');
%! assert (isequal (r, false))
%!test
%! r = python_cmd ('return Version("0.7.6") >= Version("0.7.6"),');
%! assert (isequal (r, true))
%!xtest
%! % see: https://github.com/cbm755/octsympy/pull/320
%! r = python_cmd ('return Version("0.7.6") > Version("0.7.6.dev"),');
%! assert (isequal (r, true))
%!test
%! r = python_cmd ('return Version("0.7.6") >= Version("0.7.6.dev"),');
%! assert (isequal (r, true))
%!test
%! r = python_cmd ('return Version("0.7.6.1") > Version("0.7.6"),');
%! assert (isequal (r, true))
%!test
%! r = python_cmd ('return Version("0.7.6.1") >= Version("0.7.6"),');
%! assert (isequal (r, true))
%!test
%! r = python_cmd ('return Version("0.7.6.1.dev") >= Version("0.7.6"),');
%! assert (isequal (r, true))
%!test
%! r = python_cmd ('return Version("0.7.6.dev") >= Version("0.7.5"),');
%! assert (isequal (r, true))
%!test
%! r = python_cmd ('return Version("1.0.1") > Version("1.0"),');
%! assert (isequal (r, true))
%!test
%! r = python_cmd ('return Version("1.0") > Version("0.7.6"),');
%! assert (isequal (r, true))
|