octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assert question


From: Robert T. Short
Subject: Re: Assert question
Date: Thu, 04 Mar 2010 15:14:02 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0

David Bateman wrote:
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)))


Ahh!  Sorry for the noise.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]