Skip to content

Commit

Permalink
anonymous-function.tst: New file for anonymous function BIST tests.
Browse files Browse the repository at this point in the history
* test/anonymous-function.tst: Add BIST test for bug #64783.

* test/Makefile.am: Add anonymous-function.tst to build system.
  • Loading branch information
Rik committed Feb 1, 2024
1 parent 31fa27b commit 7d588a5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $(DIRSTAMP_FILES):

TEST_FILES += \
fntests.m \
anonymous-function.tst \
args.tst \
bug-31371.tst \
bug-40117.tst \
Expand Down
30 changes: 30 additions & 0 deletions test/anonymous-function.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
########################################################################
##
## Copyright (C) 2024 The Octave Project Developers
##
## See the file COPYRIGHT.md in the top-level directory of this
## distribution or <https://octave.org/copyright/>.
##
## 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
## <https://www.gnu.org/licenses/>.
##
########################################################################

%!test <*64783>
%! s = struct ('re',{pi,2}, 'im',{3,4});
%! f = @(x) x.re ;
%! f(s);
%! assert (ans, pi);

0 comments on commit 7d588a5

Please sign in to comment.