diff options
author | Simon Marchetto <simon.marchetto@scilab-enterprises.com> | 2014-06-27 10:33:59 +0200 |
---|---|---|
committer | Simon Marchetto <simon.marchetto@scilab-enterprises.com> | 2014-06-27 10:33:59 +0200 |
commit | 1f9ae926568206a9a87f528778f36d78d8da1426 (patch) | |
tree | ac93b664bbb7900325ca4ee0cc0d5833f5f61276 /Examples/scilab | |
parent | 4660e693e9c1b18c21487cb3e8a714b187345c65 (diff) | |
download | swig-1f9ae926568206a9a87f528778f36d78d8da1426.tar.gz |
scilab: fix contract example (catch expected errors)
Diffstat (limited to 'Examples/scilab')
-rw-r--r-- | Examples/scilab/contract/runme.sci | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Examples/scilab/contract/runme.sci b/Examples/scilab/contract/runme.sci index 94926e987..0e73e812e 100644 --- a/Examples/scilab/contract/runme.sci +++ b/Examples/scilab/contract/runme.sci @@ -25,10 +25,17 @@ Foo_set (3.1415926); printf("Foo = %f\n", Foo_get()); // Check error message if violate contract -g = gcd(-42,105); -fact(-4); - - +try + g = gcd(-42,105); +catch + printf("%s\n", lasterror()); +end + +try + fact(-4); +catch + printf("%s\n", lasterror()); +end exit |