diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/ecl/errtest/test_iferr.cl | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/ecl/errtest/test_iferr.cl')
-rw-r--r-- | pkg/ecl/errtest/test_iferr.cl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/ecl/errtest/test_iferr.cl b/pkg/ecl/errtest/test_iferr.cl new file mode 100644 index 00000000..5cf40d6c --- /dev/null +++ b/pkg/ecl/errtest/test_iferr.cl @@ -0,0 +1,33 @@ +#{ TEST_IFERR -- Test various iferr constructs. + +procedure test_iferr (type) + +int type { prompt = "Error test code: " } + +begin + printf ("Testing iferr....\n\t") + for (i=1; i <= 5; i=i+1) { + iferr { errif (i) } then { + print (" error from test #"//i) + } else { + print (" NO error from test #"//i) + } + } + + printf ("\n\n") + printf ("Testing divzero error....\n\t") + iferr { i = 1 / 0 } then { + print (" error from divzero test") + } else { + print (" NO error from divzero test") + } + ; + + printf ("\n\n") + printf ("Testing fdivzero error....\n\t") + iferr { x = 1.0 / 0.0 } then { + print (" error from fdivzero test") + } else { + print (" NO error from fdivzero test") + } +end |