Mercurial > projects > dstress
comparison run/try_04.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/try_04.d,v 1.1 2004/09/22 20:12:54 th Exp $ | |
2 | |
3 class MyException : Exception{ | |
4 this(char[] msg){ | |
5 super(msg); | |
6 } | |
7 int x; | |
8 } | |
9 int main(){ | |
10 int check=0; | |
11 assert(check==0); | |
12 try{ | |
13 MyException e=new MyException(""); | |
14 e.x=2; | |
15 throw e; | |
16 }catch(MyException me){ | |
17 assert(me.x==2); | |
18 check+=5; | |
19 }catch(Exception){ | |
20 check+=3; | |
21 }finally{ | |
22 check++; | |
23 } | |
24 assert(check==6); | |
25 return 0; | |
26 } |