Mercurial > projects > dstress
annotate run/s/scope_20_B.d @ 1615:8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 12 Jul 2009 16:44:52 +0200 |
parents | run/a/auto_13_B.d@902d2c168029 |
children |
rev | line source |
---|---|
783 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Chris Sauls <ibisbasenji@gmail.com> | |
6 // @date@ 2005-12-10 | |
7 // @uri@ news:dneava$evs$1@digitaldaemon.com | |
1380 | 8 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=705 |
783 | 9 |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1380
diff
changeset
|
10 module dstress.run.s.scope_20_B; |
783 | 11 |
12 int[] status; | |
13 | |
14 class Class { | |
15 int id; | |
1089 | 16 |
783 | 17 this (int id) { |
18 this.id = id; | |
1091 | 19 status ~= id; |
783 | 20 } |
21 | |
22 ~this () { | |
23 status ~= -id; | |
24 } | |
25 } | |
26 | |
27 int main () { | |
1086 | 28 if(status.length != 0){ |
29 assert(0); | |
30 } | |
783 | 31 |
32 { | |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1380
diff
changeset
|
33 scope Class c = new Class(1); |
783 | 34 } |
35 | |
1086 | 36 if(status.length != 2){ |
37 assert(0); | |
38 } | |
39 if(status[0] != 1){ | |
40 assert(0); | |
41 } | |
42 if(status[1] != -1){ | |
43 assert(0); | |
44 } | |
783 | 45 |
46 { | |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1380
diff
changeset
|
47 scope Class c = new Class(2); |
783 | 48 } |
49 | |
1086 | 50 if(status.length != 4){ |
51 assert(0); | |
52 } | |
53 if(status[0] != 1){ | |
54 assert(0); | |
55 } | |
56 if(status[1] != -1){ | |
57 assert(0); | |
58 } | |
59 if(status[2] != 2){ | |
60 assert(0); | |
61 } | |
62 if(status[3] != -2){ | |
63 assert(0); | |
64 } | |
783 | 65 |
66 return 0; | |
67 } | |
68 |