annotate run/unittest_08.d @ 434:6a553efddc73

updated unittest and file handling to dmd-0.121
author thomask
date Fri, 15 Apr 2005 22:54:15 +0000
parents
children 9e0847cf535a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
434
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
1 // $HeadURL$
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
2 // $Date$
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
3 // $Author$
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
4
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
5 // Unit tests are run in the lexical order in which they appear
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
6 // within a module
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
7
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
8 // __DSTRESS_DFLAGS__ -unittest
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
9
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
10 module dstress.run.unittest_08;
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
11
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
12 int status;
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
13
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
14 static this(){
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
15 assert(status==0);
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
16 status=1;
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
17 }
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
18
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
19 unittest{
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
20 assert(status==1);
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
21 status==2;
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
22 }
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
23
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
24 template Templ(T){
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
25 int dummy;
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
26 unittest{
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
27 assert(status==2);
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
28 status==3;
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
29 }
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
30 }
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
31
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
32 class MyClass{
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
33 unittest{
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
34 assert(status==3);
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
35 status==4;
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
36 }
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
37
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
38 mixin Templ!(int);
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
39 }
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
40
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
41 int main(){
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
42 assert(status==4);
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
43 return 0;
6a553efddc73 updated unittest and file handling to dmd-0.121
thomask
parents:
diff changeset
44 }