Mercurial > hg > octave-avbm
changeset 13814:a45535d630bd
new tests for class concatentation
* test/class-concat/@foo/foo.m, test/class-concat/module.mk,
test/class-concat/test_class_concat.m: New files.
* test/Makefile.am: Include class-concat/modules.mk.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 04 Nov 2011 05:10:46 -0400 |
parents | 72875370e2d1 |
children | 0aba6f90f5f8 |
files | test/Makefile.am test/class-concat/@foo/foo.m test/class-concat/module.mk test/class-concat/test_class_concat.m |
diffstat | 4 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/test/Makefile.am +++ b/test/Makefile.am @@ -52,6 +52,7 @@ test_while.m include classes/module.mk +include class-concat/module.mk include ctor-vs-method/module.mk include fcn-handle-derived-resolution/module.mk
new file mode 100644 --- /dev/null +++ b/test/class-concat/@foo/foo.m @@ -0,0 +1,3 @@ +function r = foo () + r = class (struct (), 'foo'); +endfunction
new file mode 100644 --- /dev/null +++ b/test/class-concat/module.mk @@ -0,0 +1,5 @@ +class_concat_FCN_FILES = \ + class-concat/@foo/foo.m \ + class-concat/test_class_concat.m + +FCN_FILES += $(class_concat_FCN_FILES)
new file mode 100644 --- /dev/null +++ b/test/class-concat/test_class_concat.m @@ -0,0 +1,14 @@ +%!test +%! f = foo (); +%! x = [f,f]; +%! assert (size (x), [1, 2]) +%! assert (class (x), "foo") + +%!test +%! f = foo (); +%! x = [f,f]; +%! tmp = num2cell (x); +%! assert (iscell (tmp)) +%! assert (size (tmp), [1, 2]) +%! assert (class (tmp{1}), "foo") +%! assert (class (tmp{2}), "foo")