changeset 31312:b01e8e322838 stable

test: Add test for number of methods with classdef in @folder (bug #62802). * test/classdef/classdef.tst: Add test for number of methods returned for classdef that defines methods in an @folder and in the function definition. * test/classdef/@class_bug62802/amethod.m, test/classdef/@class_bug62802/class_bug62802.m: Add new files. * test/classdef/module.mk: Add new files to dist.
author Markus Mützel <markus.muetzel@gmx.de>
date Mon, 17 Oct 2022 09:27:37 +0200
parents e649aa69d5bc
children 23744576f53f 927c8d7bd8f3
files test/classdef/@class_bug62802/amethod.m test/classdef/@class_bug62802/class_bug62802.m test/classdef/classdef.tst test/classdef/module.mk
diffstat 4 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/classdef/@class_bug62802/amethod.m	Mon Oct 17 09:27:37 2022 +0200
@@ -0,0 +1,3 @@
+function amethod (obj)
+## This method is stored in a separate file.
+endfunction
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/classdef/@class_bug62802/class_bug62802.m	Mon Oct 17 09:27:37 2022 +0200
@@ -0,0 +1,18 @@
+classdef class_bug62802
+## Test class with methods in a @folder and in the classdef definition
+
+  methods
+
+    function obj = class_bug62802 ()
+    endfunction
+
+    function foo (obj)
+    endfunction
+
+    function disp (obj)
+      fprintf ("Hello\n");
+    endfunction
+
+  endmethods
+
+endclassdef
--- a/test/classdef/classdef.tst	Sat Oct 15 18:46:04 2022 +0200
+++ b/test/classdef/classdef.tst	Mon Oct 17 09:27:37 2022 +0200
@@ -210,3 +210,6 @@
 %! x = bug_60763 ();
 %! assert (x.foobar (), {"some_property"});
 %! assert (x.methods (), 42);
+
+## test class with methods in @folder and in classdef definition
+%!assert <*62802> (numel (methods ("class_bug62802")), 4)
--- a/test/classdef/module.mk	Sat Oct 15 18:46:04 2022 +0200
+++ b/test/classdef/module.mk	Mon Oct 17 09:27:37 2022 +0200
@@ -1,4 +1,6 @@
 classdef_TEST_FILES = \
+  %reldir%/@class_bug62802/amethod.m \
+  %reldir%/@class_bug62802/class_bug62802.m \
   %reldir%/bug_60763.m \
   %reldir%/class_bug52614A.m \
   %reldir%/class_bug52614B.m \