Mercurial > octave-nkf
annotate test/test_eval-catch.m @ 8710:739141cde75a ss-3-1-52
fix typo in Array-f.cc
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 09 Feb 2009 21:51:31 +0100 |
parents | 3092dd54ad95 |
children | eb63fbe60fab |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 2006, 2007 John W. Eaton |
7016 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
5590 | 19 %% Automatically generated from DejaGNU files |
20 | |
21 %% test/octave.test/eval-catch/eval-catch-1.m | |
22 %!test | |
23 %! eval ("clear a; a;", ""); | |
24 | |
25 %% test/octave.test/eval-catch/eval-catch-2.m | |
26 %!test | |
27 %! eval ("", "error('Shouldn't get here');"); | |
28 | |
29 %% test/octave.test/eval-catch/eval-catch-3.m | |
30 %!test | |
31 %! eval ("clear a; a; x = 0;", "x = 1;"); | |
32 %! assert (x, 1); | |
33 | |
5775 | 34 %% FIXME This is redundant with the changes to the above |
5590 | 35 %% test/octave.test/eval-catch/eval-catch-4.m |
36 | |
37 %% test/octave.test/eval-catch/eval-catch-5.m | |
38 %!test | |
39 %! eval ("clear a; a; str = '';", "str=lasterr;"); | |
7883
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
40 %! assert(lasterr()(1:13),"`a' undefined"); |
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
41 %! assert(str(1:13),"`a' undefined"); |
5590 | 42 |
43 %% test/octave.test/eval-catch/eval-catch-6.m | |
44 %!test | |
45 %! eval ("error (\"user-defined error\"); str = '';", "str = lasterr;"); | |
7883
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
46 %! assert(lasterr()(1:18),"user-defined error"); |
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
47 %! assert(str(1:18),"user-defined error"); |
5590 | 48 |
49 %% test/octave.test/eval-catch/eval-catch-7.m | |
50 %!function ms = mangle (s) | |
51 %! ## Wrap angle brackets around S. | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7017
diff
changeset
|
52 %! ms = cstrcat ("<", s, ">"); |
5590 | 53 %!test |
54 %! eval ("clear a; a; str='';", "str = mangle (lasterr);"); | |
7883
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
55 %! assert(mangle(lasterr)(1:14),"<`a' undefined"); |
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
56 %! assert(str(1:14),"<`a' undefined"); |
5590 | 57 |
58 %% test/octave.test/eval-catch/eval-catch-8.m | |
59 %!test | |
60 %! eval ("eval (\"clear a; a;str1='';\", \"str1=lasterr;\"); clear b; b; str2='';", | |
61 %! "str2 = lasterr;"); | |
7883
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
62 %! assert(str1(1:13),"`a' undefined"); |
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
63 %! assert(str2(1:13),"`b' undefined"); |
5590 | 64 |
65 %% test/octave.test/eval-catch/eval-catch-9.m | |
66 %!test | |
67 %! eval ("clear a; a; str1='';", | |
68 %! "eval (\"clear b; b; str2='';\", \"str2=lasterr;\"); str1=lasterr;"); | |
7883
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
69 %! assert(str1(1:13),"`b' undefined"); |
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
70 %! assert(str2(1:13),"`b' undefined"); |
5590 | 71 |
72 %% test/octave.test/eval-catch/eval-catch-10.m | |
73 %!test | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7017
diff
changeset
|
74 %! eval ("eval (\"clear a; a; str='';\",\"error (cstrcat (\\\"rethrow: \\\", lasterr));str='';\");", |
5590 | 75 %! "str=lasterr;"); |
7883
3092dd54ad95
fix expected output from lasterr in tests; fix fail tests in ismember.m
John W. Eaton <jwe@octave.org>
parents:
7540
diff
changeset
|
76 %! assert(str(1:22),"rethrow: `a' undefined"); |