Changeset 1983

Show
Ignore:
Timestamp:
09/27/06 20:57:55
Author:
miyagawa
Message:

display ID when new task is created.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • misc/todo.pl

    r1979 r1983  
    255255 
    256256    my $result = call(CreateTask => %task); 
    257     result_ok($result, "Created task"); 
     257    result_ok($result, sub { "Created task " . $locator->encode($result->{_content}->{id}) }); 
    258258} 
    259259 
     
    445445 
    446446Make sure that a result returned by C<call> indicates success. If so, 
    447 print MESSAGE. Otherwise, die with a descriptive error. 
     447print MESSAGE. If MESSAGE is a subroutine reference, execute it to get 
     448the message. Otherwise, die with a descriptive error. 
    448449 
    449450=cut 
     
    454455 
    455456    if(!$result->{failure}) { 
    456         print "$message\n"; 
     457        print ref($message) ? $message->() . "\n" : "$message\n"; 
    457458    } else { 
    458459        die(YAML::Dump($result));