PageRenderTime 32ms CodeModel.GetById 15ms app.highlight 13ms RepoModel.GetById 2ms app.codeStats 0ms

/t/classtest.t

http://github.com/NotFound/winxed
Unknown | 40 lines | 34 code | 6 blank | 0 comment | 0 complexity | 2fadb7d5e5ae91454bd8306e9686d2c6 MD5 | raw file
 1#! winxed
 2
 3// Mininal tests of class
 4
 5using extern Test.More plan, ok;
 6
 7class Foo
 8{
 9    function num () { return 1; }
10    function do()
11    {
12        ok(1);
13    }
14}
15
16class Bar
17{
18    function num () { return 2; }
19    function do()
20    {
21        ok(1);
22        ok(1);
23    }
24}
25
26function main()
27{
28    var tests = [ new Foo, new Bar ];
29    var t;
30    int total= 0;
31    for (t in tests)
32    {
33        total = total + t.num();
34    }
35    plan(total);
36    for (t in tests)
37        t.do();
38}
39
40// End