Mercurial > octave-nkf
comparison test/try.tst @ 17283:e6c0ac8ce5b6
eliminate parse conflicts introduced by changeset 923ce8b42db2
* oct-parse.in.yy (opt_identifier): Delete.
(TRY): Simplify grammar.
(octave_base_parser::make_try_command): Pass separator token instead
of exception identifier. Handle exception identifier here based on
context instead of in grammar rules.
* parse.h (octave_base_parser::make_try_command): Fix decl.
* try.tst: New tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Aug 2013 06:42:54 -0400 |
parents | 923ce8b42db2 |
children | 5a65b2cc9508 |
comparison
equal
deleted
inserted
replaced
17282:a69dd4b0e571 | 17283:e6c0ac8ce5b6 |
---|---|
156 %! end_try_catch | 156 %! end_try_catch |
157 %! catch myerr2 | 157 %! catch myerr2 |
158 %! assert (myerr1.message, myerr2.message); | 158 %! assert (myerr1.message, myerr2.message); |
159 %! assert (myerr1.identifier, myerr2.identifier); | 159 %! assert (myerr1.identifier, myerr2.identifier); |
160 %! end_try_catch | 160 %! end_try_catch |
161 | |
162 %!test | |
163 %! x = 1; | |
164 %! try error ("foo"); catch x; assert (x.message, "foo"); end_try_catch | |
165 | |
166 %!test | |
167 %! x = 1; | |
168 %! try error ("foo"); catch x end_try_catch | |
169 %! assert (x.message, "foo"); | |
170 | |
171 %!test | |
172 %! x = 1; | |
173 %! try error ("foo"); catch, x; assert (x, 1); end_try_catch | |
174 | |
175 %!test | |
176 %! x = 1; | |
177 %! try error ("foo"); catch; x; assert (x, 1); end_try_catch | |
178 | |
179 %!test | |
180 %! x = 1; | |
181 %! try error ("foo"); catch | |
182 %! x; assert (x, 1); end_try_catch |