comparison test/fcn-handle/keyword.tst @ 28156:22cddebcb0d0 stable

allow @get and @set to work properly again (bug #57988) * lex.h, lex.ll (base_lexer::is_keyword_token): Delete. Replace all uses with iskeyword. (Fiskeyword): When creating list, also omit "enumeration", "events", "methods", and "properties". * keyword.tst: New file. * test/fcn-handle/module.mk: Update
author John W. Eaton <jwe@octave.org>
date Thu, 12 Mar 2020 23:51:49 -0400
parents
children 0a5b15007766
comparison
equal deleted inserted replaced
28154:e7fe6703a81f 28156:22cddebcb0d0
1 ########################################################################
2 ##
3 ## Copyright (C) 2020 The Octave Project Developers
4 ##
5 ## See the file COPYRIGHT.md in the top-level directory of this
6 ## distribution or <https://octave.org/copyright/>.
7 ##
8 ## This file is part of Octave.
9 ##
10 ## Octave is free software: you can redistribute it and/or modify it
11 ## under the terms of the GNU General Public License as published by
12 ## the Free Software Foundation, either version 3 of the License, or
13 ## (at your option) any later version.
14 ##
15 ## Octave is distributed in the hope that it will be useful, but
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ## GNU General Public License for more details.
19 ##
20 ## You should have received a copy of the GNU General Public License
21 ## along with Octave; see the file COPYING. If not, see
22 ## <https://www.gnu.org/licenses/>.
23 ##
24 ########################################################################
25
26 %!test <*57988>
27 %! fh = @get;
28 %! fh = @set;
29 %! fh = @enumeration;
30 %! fh = @events;
31 %! fh = @methods;
32 %! fh = @properties;
33
34 %!test <*57988>
35 %! kwords = iskeyword ();
36 %! for i = 1:numel (kwords)
37 %! unexpected_success = true;
38 %! kword = kwords{i};
39 %! try
40 %! eval (sprintf ("@%s;", kword));
41 %! catch
42 %! unexpected_success = false;
43 %! end_try_catch
44 %! if (unexpected_success)
45 %! error ("constructing function handle from keyword '%s' succeeded!",
46 %! kword);
47 %! endif
48 %! endfor