0
|
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 }
|