297
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ zwang <nehzgnaw@gmail.com>
|
|
6 // @date@ 2005-02-19
|
|
7 // @uri@ news:cv7gn5$2irj$1@digitaldaemon.com
|
1487
|
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3022
|
297
|
9
|
|
10 module dstress.run.sort_15;
|
|
11
|
|
12 int main(){
|
|
13 idouble[] array;
|
|
14 array.length=10;
|
|
15 array[0]=idouble.max;
|
|
16 array[1]=0.875i;
|
|
17 array[2]=0.75i;
|
|
18 array[3]=0.625i;
|
|
19 array[4]=0.5i;
|
|
20 array[5]=0.375i;
|
|
21 array[6]=0.25i;
|
|
22 array[7]=0.125i;
|
|
23 array[8]=0.0i;
|
|
24 array[9]=idouble.min;
|
|
25
|
|
26 idouble[] sorted_copy = array.sort;
|
|
27
|
|
28 assert(array.length==10);
|
|
29 assert(array[0]==0.0i);
|
|
30 assert(array[1]==idouble.min);
|
|
31 assert(array[2]==0.125i);
|
|
32 assert(array[3]==0.25i);
|
|
33 assert(array[4]==0.375i);
|
|
34 assert(array[5]==0.5i);
|
|
35 assert(array[6]==0.625i);
|
|
36 assert(array[7]==0.75i);
|
|
37 assert(array[8]==0.875i);
|
|
38 assert(array[9]==idouble.max);
|
|
39
|
|
40 assert(sorted_copy.length==10);
|
|
41 assert(sorted_copy[0]==0.0i);
|
|
42 assert(sorted_copy[1]==idouble.min);
|
|
43 assert(sorted_copy[2]==0.125i);
|
|
44 assert(sorted_copy[3]==0.25i);
|
|
45 assert(sorted_copy[4]==0.375i);
|
|
46 assert(sorted_copy[5]==0.5i);
|
|
47 assert(sorted_copy[6]==0.625i);
|
|
48 assert(sorted_copy[7]==0.75i);
|
|
49 assert(sorted_copy[8]==0.875i);
|
|
50 assert(sorted_copy[9]==idouble.max);
|
|
51
|
|
52 return 0;
|
|
53 }
|