[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Assert question
From: |
David Bateman |
Subject: |
Re: Assert question |
Date: |
Fri, 05 Mar 2010 00:12:05 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20090706) |
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)))
--
David Bateman address@hidden
35 rue Gambetta +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)