Changeset 21176

Show
Ignore:
Timestamp:
07/03/08 14:09:33 (5 months ago)
Author:
moritz
Message:

[spec] enhanced index.t a bit

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • t/spec/S29-str/index.t

    r21154 r21176  
    44# L<S29/Str/"=item index"> 
    55 
    6 plan 33; 
     6plan 34; 
    77 
    88# Type of return value 
     9#?rakudo todo 'successful index() should return a StrPos' 
    910isa_ok('abc'.index('b'), StrPos); 
    1011isa_ok('abc'.index('d'), StrPos); 
     12ok(!'abc'.index('d'), 'failure object from index() evaluates to false'); 
    1113 
    1214# Simple - with just a single char 
     
    3537is(index("Hello World", ""), 0, "Substr is empty"); 
    3638is(index("", ""), 0, "Both strings are empty"); 
    37 ok(!index("", "Hello") "Only main-string is empty"); 
     39ok(!defined(index("", "Hello")), "Only main-string is empty"); 
    3840is(index("Hello", "", 3), 3, "Substr is empty, pos within str"); 
    3941is(index("Hello", "", 5), 5, "Substr is empty, pos at end of str"); 
     
    7173ok($j.index("l")  == 3, ".index on junction"); 
    7274 
    73