Mercurial > projects > dstress
annotate run/auto_02.d @ 1:3414705c41ac
removed CVS header
author | thomask |
---|---|
date | Sun, 26 Sep 2004 12:06:09 +0000 |
parents | 3269e4627918 |
children | f87ba6507260 |
rev | line source |
---|---|
0 | 1 |
2 // @author@ Sean Kelly <sean@f4.ca> | |
3 // @date@ 2004-09-11 | |
4 | |
5 int status; | |
6 | |
7 auto class AutoClass{ | |
8 void bad(){ | |
9 throw new Exception("error msg"); | |
10 } | |
11 ~this(){ | |
12 assert(status==0); | |
13 status--; | |
14 } | |
15 } | |
16 | |
17 void test(){ | |
18 try{ | |
19 auto AutoClass ac = new AutoClass(); | |
20 ac.bad(); | |
21 }catch{ | |
22 } | |
23 } | |
24 | |
25 int main(){ | |
26 assert(status==0); | |
27 test(); | |
28 assert(status==-1); | |
29 return 0; | |
30 } |