octave-maintainers
[Top][All Lists]
Advanced

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

failing tests in tip


From: John W. Eaton
Subject: failing tests in tip
Date: Fri, 13 Mar 2009 10:41:33 -0400

On 13-Mar-2009, Jaroslav Hajek wrote:

| my recent changes ("more indexing improvements") introduced a number
| of failing tests in tip. These are caused by the fact that ones(1,n)
| will now produce a range rather than matrix, thus giving an error when
| compared against an equivalent matrix value by "assert".
| Fixing the tests to use full(ones(..)) is trivial; however, maybe it's
| time to loosen the testing in assert a little? I recall there were
| similar problems with diagonal matrices. For instance, if both
| arguments are numeric and neither of them is sparse, full() can be
| first applied to them. There is, of course, the danger that such a
| change may let escape something unintended.
| 
| Opinions?

I think the original intent was for assert to test exact equality,
including object types.  But maybe we should only be doing that
explicitly with something like assert (isequalwithequaltypes (a, b))
(yeah, maybe it's not the best name to use for this function, but at
least it is descriptive).  OTOH, it's not clear to me how many tests
there are where we do want to require equal values and types.

You can also force conversion to a matrix by doing [ones(1,n)], at
least until you decide to optimize this too...  :-)

jwe


reply via email to

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