Mercurial > hg > octave-shane
changeset 6533:c64687e6f1c3
[project @ 2007-04-17 21:21:46 by jwe]
author | jwe |
---|---|
date | Tue, 17 Apr 2007 21:21:46 +0000 |
parents | 25cad08843a0 |
children | 7f56be6b0902 |
files | scripts/ChangeLog scripts/set/ismember.m |
diffstat | 2 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2007-04-17 John W. Eaton <jwe@octave.org> + + * set/ismember.m: New tests. + From David Grohmann <grohmann@arlut.utexas.edu> + 2007-04-17 Paul Kienzle <pkienzle@users.sf.net> * specfun/factorial.m: Use gamma function instead of cumprod.
--- a/scripts/set/ismember.m +++ b/scripts/set/ismember.m @@ -108,4 +108,10 @@ endif endfunction - + +%!assert (ismember ({''}, {'abc', 'def'}), false); +%!assert (ismember ('abc', {'abc', 'def'}), true); +%!assert (isempty (ismember ([], [1, 2])), true); +%!assert (ismember ('', {'abc', 'def'}), false); +%!fail (ismember ([], {1, 2}), 'error:.*'); +%!fail (ismember ({[]}, {1, 2}), 'error:.*');