Robert T. Short wrote:
Why does the following fail? This is octave 3.2.3.
octave:1> assert(ones(1,2),[1 1])
error: assert (ones (1, 2),[1, 1]) expected
1 1
but got
1 1
Type range != matrix
Bob
Check the NEWS file in the tip, which states
** The default behavior of `assert (observed, expected)' has been
relaxed to employ less strict checking that does not require the
internals of the values to match. This avoids previously valid
tests from breaking due to new internal classes introduced in future
Octave versions.
For instance, all of these assertions were true in Octave 3.0.x
but false in 3.2.x due to new optimizations and improvements:
assert (2*linspace (1, 5, 5), 2*(1:5))
assert (zeros (0, 0), [])
assert (2*ones (1, 5), (2) (ones (1,5)))