Mercurial > octave
changeset 32902:a575aa730d84 stable
anonymous-function.tst: New file for anonymous function BIST tests.
* test/anonymous-function.tst: Add BIST test for bug #64783.
* test/Makefile.am: Add anonymous-function.tst to build system.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 01 Feb 2024 15:46:53 -0800 |
parents | 4d24afc1d32b |
children | 9aeb66a38955 cf43680cd221 |
files | test/Makefile.am test/anonymous-function.tst |
diffstat | 2 files changed, 31 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/test/Makefile.am Thu Feb 01 13:28:20 2024 -0500 +++ b/test/Makefile.am Thu Feb 01 15:46:53 2024 -0800 @@ -17,6 +17,7 @@ TEST_FILES += \ fntests.m \ + anonymous-function.tst \ args.tst \ bug-31371.tst \ bug-40117.tst \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/anonymous-function.tst Thu Feb 01 15:46:53 2024 -0800 @@ -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);