227
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
226
|
5 module dstress.run.rehash_01;
|
|
6
|
|
7 int main(){
|
|
8 int[char[]] array;
|
|
9 array["eins"]=1;
|
|
10 array["zwei"]=2;
|
|
11 array["drei"]=3;
|
|
12
|
|
13 assert(array.length==3);
|
|
14
|
457
|
15 int[char[]] rehashed=array.rehash;
|
528
|
16 assert(rehashed is array);
|
226
|
17
|
|
18 char[][] key = array.keys;
|
|
19 assert(key.length==3);
|
|
20
|
|
21 bool have[3];
|
|
22
|
|
23 assert(!have[0]);
|
|
24 assert(!have[1]);
|
|
25 assert(!have[2]);
|
|
26
|
|
27 foreach(char[] value; key){
|
|
28 switch(value){
|
|
29 case "eins":{
|
|
30 have[0]=true;
|
|
31 break;
|
|
32 }case "zwei":{
|
|
33 have[1]=true;
|
|
34 break;
|
|
35 }case "drei":{
|
|
36 have[2]=true;
|
|
37 break;
|
|
38 }default:{
|
|
39 assert(0);
|
|
40 }
|
|
41 }
|
|
42 }
|
|
43
|
|
44 assert(have[0]);
|
|
45 assert(have[1]);
|
|
46 assert(have[2]);
|
|
47
|
|
48 return 0;
|
|
49 }
|