Mercurial > projects > ldc
annotate tests/mini/throw1.d @ 1118:dde9dbae052a
Make this test a bit more meaningful
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sat, 14 Mar 2009 22:29:31 +0100 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
34 | 1 module throw1; |
2 | |
3 extern(C) int rand(); | |
4 | |
5 class C | |
6 { | |
7 } | |
8 | |
100 | 9 void func(bool b) |
34 | 10 { |
100 | 11 if (b) |
34 | 12 throw new C; |
13 } | |
14 | |
15 int main() | |
16 { | |
100 | 17 bool b = true; |
34 | 18 try |
19 { | |
100 | 20 func(b); |
34 | 21 } |
22 catch(Object) | |
23 { | |
341
1bb99290e03a
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
lindquist
parents:
100
diff
changeset
|
24 return 0; |
34 | 25 } |
341
1bb99290e03a
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
lindquist
parents:
100
diff
changeset
|
26 return 1; |
34 | 27 } |