Mercurial > projects > dstress
annotate run/sort_03.d @ 1619:bebc7472a832
Fix #7.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 07 Nov 2009 18:55:30 +0100 |
parents | 6e4063f99377 |
children |
rev | line source |
---|---|
140 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
38
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
5 // @author@ Russ Lewis <spamhole-2001-07-16@deming-os.org> |
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
6 // @date@ 2004-10-11 |
140 | 7 // @uri@ news:ckdc4r$re2$1@digitaldaemon.com |
1487 | 8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2068 |
67 | 9 |
10 module dstress.run.sort_03; | |
38
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
11 |
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
12 int main(){ |
297 | 13 real[] array; |
14 array.length=10; | |
49 | 15 array[0]=real.max; |
16 array[1]=0.875; | |
17 array[2]=0.75; | |
18 array[3]=0.625; | |
19 array[4]=0.5; | |
20 array[5]=0.375; | |
21 array[6]=0.25; | |
22 array[7]=0.125; | |
23 array[8]=0.0; | |
24 array[9]=real.min; | |
38
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
25 |
297 | 26 real[] sorted_copy = array.sort; |
38
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
27 |
49 | 28 assert(sorted_copy.length==10); |
297 | 29 assert(sorted_copy[0]==0.0); |
30 assert(sorted_copy[1]==real.min); | |
31 assert(sorted_copy[2]==0.125); | |
32 assert(sorted_copy[3]==0.25); | |
33 assert(sorted_copy[4]==0.375); | |
34 assert(sorted_copy[5]==0.5); | |
35 assert(sorted_copy[6]==0.625); | |
36 assert(sorted_copy[7]==0.75); | |
37 assert(sorted_copy[8]==0.875); | |
38 assert(sorted_copy[9]==real.max); | |
38
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
39 |
297 | 40 assert(array.length==10); |
41 assert(array[0]==0.0); | |
42 assert(array[1]==real.min); | |
43 assert(array[2]==0.125); | |
44 assert(array[3]==0.25); | |
45 assert(array[4]==0.375); | |
46 assert(array[5]==0.5); | |
47 assert(array[6]==0.625); | |
48 assert(array[7]==0.75); | |
49 assert(array[8]==0.875); | |
50 assert(array[9]==real.max); | |
51 | |
52 assert(&array != &sorted_copy); | |
53 | |
38
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
54 return 0; |
cc64b53095b1
added bug report nttp://digitalmars.com/digitalmars.D.bugs:2068 / <ckdc4r$re2$1@digitaldaemon.com> as sort_03
thomask
parents:
diff
changeset
|
55 } |