Mercurial > hg > octave-nkf
changeset 15967:24ceda35d146 classdef
Add classdef tests for method changing the size of a property.
* test/classdef/foo_method_changes_property_size.m: New file.
* test/classdef/module.mk: Add new file.
* test/classdef/test_classdef.m: Add test.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sun, 20 Jan 2013 14:50:04 -0500 |
parents | a3d7b927ce47 |
children | cdeb6eb656be |
files | test/classdef/foo_method_changes_property_size.m test/classdef/module.mk test/classdef/test_classdef.m |
diffstat | 3 files changed, 21 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/test/classdef/foo_method_changes_property_size.m @@ -0,0 +1,14 @@ +classdef foo_method_changes_property_size + properties + element; + end + methods + function obj = foo_method_changes_property (n) + obj.element = 1:n; + end + function obj = move_element_to_end (obj, n) + obj.element(end+1) = obj.element(n);; + obj.element(n) = []; + end + end +end
--- a/test/classdef/module.mk +++ b/test/classdef/module.mk @@ -1,6 +1,7 @@ classdef_FCN_FILES = \ + classdef/foo_method_changes_property_size.m \ + classdef/foo_static_method_constant_property.m \ classdef/foo_value_class.m \ - classdef/foo_static_method_constant_property.m \ classdef/test_classdef.m FCN_FILES += $(classdef_FCN_FILES)
--- a/test/classdef/test_classdef.m +++ b/test/classdef/test_classdef.m @@ -67,3 +67,8 @@ %! obj.frequency = 10; %! assert (obj.cosine (0.1), cos (2 * pi * 10 * 0.1), eps ()) %! assert (obj.sine (0.1), sin (2 * pi * 10 * 0.1), eps ()) + +%!xtest +%! obj = foo_method_changes_property (3); +%! obj = obj.move_element_to_end (2); +%! assert (obj.element, [1 3 2])