getf SCI/util/testexamples.sci reinit_for_test() %U=mopen('SCI/tests/automatic_tests/execstr_data.ref','rb'); %ans = execstr('a=1'); if load_ref('%ans') then bugmes();quit;end, // sets a=1. %ans = execstr('1+1'); if load_ref('%ans') then bugmes();quit;end, // does nothing (while evstr('1+1') returns 2) %ans = execstr(['if %t then'; ' a=1'; ' b=a+1'; 'else'; ' b=0'; 'end']); if load_ref('%ans') then bugmes();quit;end, %ans = execstr('a=zzzzzzz', 'errcatch'); if load_ref('%ans') then bugmes();quit;end, %ans = execstr('a=zzzzzzz', 'errcatch', 'm'); a=zzzzzzz !--error 4 undefined variable : zzzzzzz if load_ref('%ans') then bugmes();quit;end, //syntax errors %ans = execstr('a=1?02', 'errcatch'); if load_ref('%ans') then bugmes();quit;end, %ans = lasterror(%t); if load_ref('%ans') then bugmes();quit;end, %ans = execstr('a=[1 2 3)', 'errcatch'); if load_ref('%ans') then bugmes();quit;end, %ans = lasterror(%t); if load_ref('%ans') then bugmes();quit;end, xdel_run(winsid()); mclose(%U);