Mercurial > hg > octave-nkf
view test/test_unwind.m @ 5851:acb4a1e0b311 ss-2-9-6
[project @ 2006-06-09 16:34:42 by jwe]
author | jwe |
---|---|
date | Fri, 09 Jun 2006 16:37:20 +0000 |
parents | 1ad66ea35fe5 |
children | 93c65f2a5668 |
line wrap: on
line source
%% Automatically generated from DejaGNU files %% test/octave.test/unwind/unwind-1.m %!function y = f (x) %! global g; %! save_g = g; %! unwind_protect %! g = 0; %! y = g; %! [1,2;x]; %! g = 1; %! y = [y, g]; %! unwind_protect_cleanup %! g = save_g; %! y = [y, g]; %! end_unwind_protect %!test %! global g = -1; %! y = f ([3,4]); %! assert(y,[0,1,-1]); %% test/octave.test/unwind/unwind-2.m %!function y = f (x) %! global g; %! save_g = g; %! unwind_protect %! g = 0; %! y = g; %! [1,2;x]; %! g = 1; %! y = [y, g]; %! unwind_protect_cleanup %! g = save_g; %! y = [y, g]; %! assert(y,[0,-1]); %! end_unwind_protect %!test %! global g = -1; %! fail("y = f (3);","number of columns must match");