Mercurial > octave-nkf
comparison scripts/testfun/assert.m @ 6455:e68b6921b221
[project @ 2007-03-26 16:02:04 by jwe]
author | jwe |
---|---|
date | Mon, 26 Mar 2007 16:02:04 +0000 |
parents | e8c42df3d234 |
children | 76a1a953533d |
comparison
equal
deleted
inserted
replaced
6454:7c9b4a6e090b | 6455:e68b6921b221 |
---|---|
115 endfor | 115 endfor |
116 catch | 116 catch |
117 iserror = 1; | 117 iserror = 1; |
118 end | 118 end |
119 endif | 119 endif |
120 | |
121 elseif (isempty (expected)) | |
122 iserror = (any (size (cond) != size (expected))); | |
123 | 120 |
124 elseif (ndims (cond) != ndims (expected) | 121 elseif (ndims (cond) != ndims (expected) |
125 || any (size (cond) != size (expected))) | 122 || any (size (cond) != size (expected))) |
126 iserror = 1; | 123 iserror = 1; |
127 coda = "Dimensions don't match"; | 124 coda = "Dimensions don't match"; |
195 ## empty | 192 ## empty |
196 %!assert([]) | 193 %!assert([]) |
197 %!assert(zeros(3,0),zeros(3,0)) | 194 %!assert(zeros(3,0),zeros(3,0)) |
198 %!error assert(zeros(3,0),zeros(0,2)) | 195 %!error assert(zeros(3,0),zeros(0,2)) |
199 %!error assert(zeros(3,0),[]) | 196 %!error assert(zeros(3,0),[]) |
197 %!fail("assert(zeros(2,0,2),zeros(2,0))", "Dimensions don't match") | |
200 | 198 |
201 ## conditions | 199 ## conditions |
202 %!assert(isempty([])) | 200 %!assert(isempty([])) |
203 %!assert(1) | 201 %!assert(1) |
204 %!error assert(0) | 202 %!error assert(0) |