[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: failing tests in tip
From: |
John W. Eaton |
Subject: |
Re: failing tests in tip |
Date: |
Fri, 13 Mar 2009 12:07:45 -0400 |
On 13-Mar-2009, Jaroslav Hajek wrote:
| I fixed those tests using "full". Still, my comment is valid - there
| is no good way to test for
| exact numeric equality. What about the following small patch? It seems
| that this was the intention
| after all, judging by the surrounding code.
| # HG changeset patch
| # User Jaroslav Hajek <address@hidden>
| # Date 1236959387 -3600
| # Node ID d4aa946efab7a9705cb78dd5175b56bc4e334b0b
| # Parent 2e9af33636694e611a08e4f00c70c13491d180b7
| have zero tolerance force numeric assert
|
| diff --git a/scripts/testfun/assert.m b/scripts/testfun/assert.m
| --- a/scripts/testfun/assert.m
| +++ b/scripts/testfun/assert.m
| @@ -141,7 +141,7 @@
| iserror = 1;
| coda = "Dimensions don't match";
|
| - elseif (tol == 0 && ! strcmp (typeinfo (cond), typeinfo (expected)))
| + elseif (nargin < 3 && ! strcmp (typeinfo (cond), typeinfo (expected)))
| iserror = 1;
| coda = cstrcat ("Type ", typeinfo (cond), " != ", typeinfo (expected));
Maybe I'm missing something, but how does that change the behavior of
assert given the
if (nargin < 3)
tol = 0;
block near the beginning of the function?
jwe