Mercurial > projects > dstress
comparison run/s/scope_20_A.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_A.d@902d2c168029 |
children |
comparison
equal
deleted
inserted
replaced
1614:709f6451b315 | 1615:8d5c55d163fd |
---|---|
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 | |
8 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=705 | |
9 | |
10 module dstress.run.s.scope_20_A; | |
11 | |
12 int[] status; | |
13 | |
14 class Class { | |
15 int id; | |
16 | |
17 this (int id) { | |
18 this.id = id; | |
19 status ~= id; | |
20 } | |
21 | |
22 ~this () { | |
23 status ~= -id; | |
24 } | |
25 } | |
26 | |
27 template Template (int id) { | |
28 scope Class c = new Class(id); | |
29 } | |
30 | |
31 int main () { | |
32 if(status.length != 0){ | |
33 assert(0); | |
34 } | |
35 | |
36 { | |
37 mixin Template!(1); | |
38 } | |
39 | |
40 if(status.length != 2){ | |
41 assert(0); | |
42 } | |
43 if(status[0] != 1){ | |
44 assert(0); | |
45 } | |
46 if(status[1] != -1){ | |
47 assert(0); | |
48 } | |
49 | |
50 { | |
51 mixin Template!(2); | |
52 } | |
53 | |
54 if(status.length != 4){ | |
55 assert(0); | |
56 } | |
57 if(status[0] != 1){ | |
58 assert(0); | |
59 } | |
60 if(status[1] != -1){ | |
61 assert(0); | |
62 } | |
63 if(status[2] != 2){ | |
64 assert(0); | |
65 } | |
66 if(status[3] != -2){ | |
67 assert(0); | |
68 } | |
69 | |
70 return 0; | |
71 } | |
72 |