# HG changeset patch # User Mike Miller # Date 1491279127 25200 # Node ID 67a638ac7f2491681157183508f8b2f974b639a3 # Parent 8a23ed65ef218b8bfe0bb316b331b0361a99c420 Add test case for classdef with local functions (bug #41723) * test/bug-41723/bug-41723.tst, test/bug-41723/class_bug41723.m, test/bug-41723/module.mk: New test files. * test/module.mk: Update to include bug-41723. diff -r 8a23ed65ef21 -r 67a638ac7f24 test/bug-41723/bug-41723.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-41723/bug-41723.tst Mon Apr 03 21:12:07 2017 -0700 @@ -0,0 +1,22 @@ +## Copyright (C) 2017 Mike Miller +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or +## (at your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%!test <41723> +%! a = class_bug41723 (); +%! assert (a.value, 42); +%! assert (a.getval (), 84); diff -r 8a23ed65ef21 -r 67a638ac7f24 test/bug-41723/class_bug41723.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-41723/class_bug41723.m Mon Apr 03 21:12:07 2017 -0700 @@ -0,0 +1,25 @@ +classdef class_bug41723 < handle + properties + value + endproperties + methods + function obj = class_bug41723 () + obj.value = helper_function (); + endfunction + function val = getval (obj) + val = helper_function_2 (); + endfunction + endmethods +endclassdef + +function y = helper_function () + y = 42; +endfunction + +function y = helper_function_2 (in) + if (! nargin) + y = helper_function_2 (true); + else + y = 2 * helper_function (); + endif +endfunction diff -r 8a23ed65ef21 -r 67a638ac7f24 test/bug-41723/module.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-41723/module.mk Mon Apr 03 21:12:07 2017 -0700 @@ -0,0 +1,5 @@ +bug_41723_TEST_FILES = \ + test/bug-41723/bug-41723.tst \ + test/bug-41723/class_bug41723.m + +TEST_FILES += $(bug_41723_TEST_FILES) diff -r 8a23ed65ef21 -r 67a638ac7f24 test/module.mk --- a/test/module.mk Fri Apr 07 18:26:18 2017 -0400 +++ b/test/module.mk Mon Apr 03 21:12:07 2017 -0700 @@ -48,6 +48,7 @@ include test/bug-36025/module.mk include test/bug-38236/module.mk include test/bug-38691/module.mk +include test/bug-41723/module.mk include test/bug-44940/module.mk include test/bug-46660/module.mk include test/bug-50014/module.mk