Mercurial > projects > dstress
comparison run/auto_02.d @ 0:3269e4627918
init dstress
author | svnowner |
---|---|
date | Sat, 25 Sep 2004 22:33:30 +0000 |
parents | |
children | 3414705c41ac |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3269e4627918 |
---|---|
1 // $Header: /home/th/Dokumente/Entwicklung/MEIN_CVS/MiniD/src/run/auto_02.d,v 1.1 2004/09/23 00:33:38 th Exp $ | |
2 | |
3 // @author@ Sean Kelly <sean@f4.ca> | |
4 // @date@ 2004-09-11 | |
5 | |
6 int status; | |
7 | |
8 auto class AutoClass{ | |
9 void bad(){ | |
10 throw new Exception("error msg"); | |
11 } | |
12 ~this(){ | |
13 assert(status==0); | |
14 status--; | |
15 } | |
16 } | |
17 | |
18 void test(){ | |
19 try{ | |
20 auto AutoClass ac = new AutoClass(); | |
21 ac.bad(); | |
22 }catch{ | |
23 } | |
24 } | |
25 | |
26 int main(){ | |
27 assert(status==0); | |
28 test(); | |
29 assert(status==-1); | |
30 return 0; | |
31 } |