Changeset 22749 for t

Show
Ignore:
Timestamp:
10/25/08 11:19:58 (3 months ago)
Author:
moritz
Message:

[t] some cleanups, moved oo/attributes/class.t to spec, and cleaned up.

Location:
t
Files:
1 modified
1 moved

Legend:

Unmodified
Added
Removed
  • t/oo/methods/class.t

    r20490 r22749  
    2424    # NOTE: 
    2525    # this dies for the wrong reason actually 
     26    #?pugs todo 'class methods' 
    2627    dies_ok { 
    2728        $val = $foo.bar(42); 
    28     }, '... class methods should not work for instances', :todo<feature>; 
     29    }, '... class methods should not work for instances'; 
    2930} 
  • t/spec/S12-attributes/class2.t

    r21719 r22749  
    1212#L<S12/Class methods/metaclass method always delegated> 
    1313 
    14 plan 17; 
     14plan 14; 
    1515 
    16 ok eval('class Foo { our $.bar = 23; our $.yada is rw = 13; }; 1'), 'class attributes are parsed'; 
     16class Foo { 
     17    our $.bar = 23; 
     18    our $.yada is rw = 13; 
     19}  
    1720 
    1821my $test = 0; 
    19 ok eval('$test = Foo.bar'), 'accessors for class attributes work'; 
     22ok $test = Foo.bar, 'accessors for class attributes work'; 
    2023is $test, 23, 'class attributes really work'; 
    2124 
    22 ok eval('class Baz is Foo {}; 1'), 'inheriting class attributes parsed'; 
     25class Baz is Foo {}; 
    2326 
    2427my $test2 = 0; 
    25 ok eval('$test2 = Baz.bar'), 'inherited class attribute accessors work'; 
     28lives_ok { $test2 = Baz.bar }, 'inherited class attribute accessors work'; 
    2629is $test2, 23, 'inherited class attributes really work'; 
    2730 
    2831my $test3 = 0; 
    29 ok eval('Baz.yada = 42; $test3 = Baz.yada'), 'inherited rw class attribute accessors work'; 
     32lives_ok { Baz.yada = 42; $test3 = Baz.yada }, 'inherited rw class attribute accessors work'; 
    3033is $test3, 42, 'inherited rw class attributes really work'; 
    3134 
    32 ok eval('class Quux is Foo { has $.bar = 17; }; 1'), 
    33     'overriding with instance method allowed'; 
     35class Quux is Foo { has $.bar = 17; }; 
     36 
    3437my $test4 = 0; 
    35 ok eval('$test4 = Quux.new()'), 
     38#?pugs 99 todo 'class attributes' 
     39lives_ok { $test4 = Quux.new() }, 
    3640    'Can instantiate with overridden instance method'; 
    3741is $test4.bar, 17, 'Instance call gets instance attribute, not class attribute'; 
    3842my $test5 = 0; 
    39 ok eval('$test5 = Quux.bar'), 'class attribute still accessible via class name', :todo<feature>; 
    40 is $test5, 23, 'class attribute really works, even when overridden', :todo<feature>; 
     43lives_ok {$test5 = Quux.bar}, 'class attribute still accessible via class name'; 
     44is $test5, 23, 'class attribute really works, even when overridden'; 
    4145my $test6 = 0; 
    42 ok eval('$test6 = Quux.^bar'), 'class attribute accessible via ^name', :todo<feature>; 
    43 is $test6, 23, 'class attribute via ^name really works', :todo<feature>; 
     46lives_ok { $test6 = Quux.^bar}, 'class attribute accessible via ^name'; 
     47is $test6, 23, 'class attribute via ^name really works'; 
    4448my $test7 = 0; 
    45 ok eval('$test7 = $test4.^bar'), 
     49lives_ok {$test7 = $test4.^bar}, 
    4650    'class attribute accessible via ^name called on instance', :todo<feature>; 
    4751is $test7, 23, 'class attribute via $obj.^name really works', :todo<feature>; 
     52 
     53# vim: ft=perl6