# HG changeset patch # User Rik # Date 1292306564 28800 # Node ID e4ba3cb2d27ef67b4ea5fa3fa3900d9bb8dc4ea9 # Parent f5ee3e6e926603e78fedda780277c85ebb6b28bb isfield: Additional test for cellstring of field names diff -r f5ee3e6e9266 -r e4ba3cb2d27e src/ChangeLog --- a/src/ChangeLog Mon Dec 13 20:58:10 2010 -0800 +++ b/src/ChangeLog Mon Dec 13 22:02:44 2010 -0800 @@ -1,3 +1,7 @@ +2010-12-13 Rik + + * ov-struct.cc (isfield): Additional test for cellstring of field names. + 2010-12-13 Rik * data.cc (mod): Additional tests for mod with non-integer real values. diff -r f5ee3e6e9266 -r e4ba3cb2d27e src/ov-struct.cc --- a/src/ov-struct.cc Mon Dec 13 20:58:10 2010 -0800 +++ b/src/ov-struct.cc Mon Dec 13 22:02:44 2010 -0800 @@ -2024,12 +2024,12 @@ %!# test isfield %!test %! x(3).d=1; x(2).a=2; x(1).b=3; x(2).c=3; -%! assert (isfield (x, "b")); -%!assert( isfield( struct("a", "1"), "a")); -%!assert( isfield( {1}, "c"), logical (0)); -%!assert( isfield( struct("a", "1"), 10), logical (0)); -%!assert( isfield( struct("a", "b"), "a "), logical (0)); - +%! assert (isfield (x, 'b')); +%!assert (isfield (struct('a', '1'), 'a')); +%!assert (isfield ({1}, 'c'), false); +%!assert (isfield (struct('a', '1'), 10), false); +%!assert (isfield (struct('a', 'b'), "a "), false); +%!assert (isfield (struct('a', 1, 'b', 2), {'a', 'c'}), [true, false]); */ DEFUN (cell2struct, args, ,