Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/finally.cfa

    r3bf9d10 rd00d581  
    11// Finally Clause Tests
    22
    3 #include <fstream.hfa>
    43#include "except-io.hfa"
    54
     
    1312        try {
    1413                try {
    15                         sout | "termination throw";
     14                        printf("termination throw\n");
    1615                        throw exc;
    1716                } finally {
    1817                        loud_exit a = "termination inner finally";
    19                         sout | "finally during unwind";
     18                        printf("finally during unwind\n");
    2019                }
    2120        } catch (myth * error) {
    22                 sout | "termination catch";
     21                printf("termination catch\n");
    2322        } finally {
    2423                loud_exit a = "termination outer finally";
    25                 sout | "finally after catch";
     24                printf("finally after catch\n");
    2625        }
    27         sout | nl;
     26        printf("\n");
    2827
    2928        try {
    3029                try {
    31                         sout | "resumption throw";
     30                        printf("resumption throw\n");
    3231                        throwResume exc;
    3332                } finally {
    3433                        loud_exit a = "resumption inner finally";
    35                         sout | "finally after resume";
     34                        printf("finally after resume\n");
    3635                }
    3736        } catchResume (myth * error) {
    38                 sout | "resumption catch";
     37                printf("resumption catch\n");
    3938        } finally {
    4039                loud_exit a = "resumption outer finally";
    41                 sout | "finally after catch";
     40                printf("finally after catch\n");
    4241        }
    43         sout | "";
     42        printf("\n");
    4443
    4544        try {
    46                 sout | "walking out of try";
     45                printf("walking out of try\n");
    4746        } finally {
    4847                loud_exit a = "walking finally";
    49                 sout | "walking through finally";
     48                printf("walking through finally\n");
    5049        }
    51         sout | "";
     50        printf("\n");
    5251
    5352        try {
    54                 sout | "jumping out of try";
     53                printf("jumping out of try\n");
    5554                goto endoffunction;
    5655        } finally {
    5756                loud_exit a = "jumping finally";
    58                 sout | "jumping through finally";
     57                printf("jumping through finally\n");
    5958        }
    6059        endoffunction:
Note: See TracChangeset for help on using the changeset viewer.