comparison run/break_09.d @ 1559:ec5e144583ea

D1 -> D2 : 1/N
author thomask
date Sun, 19 Aug 2007 19:11:54 +0000
parents 85ed61918ae4
children
comparison
equal deleted inserted replaced
1558:d40d75fcd5c5 1559:ec5e144583ea
4 4
5 module dstress.run.break_09; 5 module dstress.run.break_09;
6 6
7 int status; 7 int status;
8 8
9 int test(char[][] args){ 9 int test(string[] args){
10 10
11 loop: while(1){ 11 loop: while(1){
12 try{ 12 try{
13 try{ 13 try{
14 if(args.length==1){ 14 if(args.length==1){
15 break loop; 15 break loop;
16 } 16 }
17 }finally{ 17 }finally{
18 assert(status==0); 18 if(0 != status){
19 assert(0);
20 }
19 status+=2; 21 status+=2;
20 } 22 }
21 }finally{ 23 }finally{
22 assert(status==2); 24 if(2 != status){
25 assert(0);
26 }
23 status+=3; 27 status+=3;
24 } 28 }
25 return 0; 29 return 0;
26 } 30 }
27 return -1; 31 return -1;
28 } 32 }
29 33
30 int main(char[][] args){ 34 int main(string[] args){
31 assert(status == 0); 35 if(0 != status ){
32 assert(args.length == 1); 36 assert(0);
33 assert(test(args) == -1); 37 }
34 assert(status == 5); 38 if(1 != args.length ){
39 assert(0);
40 }
41 if(-1 != test(args) ){
42 assert(0);
43 }
44 if(5 != status ){
45 assert(0);
46 }
35 return 0; 47 return 0;
36 } 48 }