Ticket #1513: test_more.patch

File test_more.patch, 2.6 KB (added by bacek, 12 years ago)

Test::More patch

  • runtime/parrot/library/Test/Builder/Test.pir

    diff --git a/runtime/parrot/library/Test/Builder/Test.pir b/runtime/parrot/library/Test/Builder/Test.pir
    index 405450e..458a461 100644
    a b  
    323323 
    324324.sub report :method 
    325325    .local pmc    passed 
    326     .local pmc    description 
     326    .local pmc    reason 
    327327    .local pmc    number 
    328328    .local string report 
    329     .local string number_string 
    330     .local string desc_string 
    331329 
    332330    passed        = self.'passed'() 
    333331    number        = self.'number'() 
    334     description   = self.'description'() 
    335332    report        = '' 
    336     number_string = number 
    337     desc_string   = description 
    338333 
    339334    if passed goto PASSED 
    340335    report      = 'not ' 
    341336 
    342337  PASSED: 
    343338    concat report, 'ok ' 
    344     concat report, number_string 
    345     concat report, ' # TODO' 
    346  
    347     unless description goto REPORT 
    348     concat report, ' ' 
    349     concat report, desc_string 
     339    $S0 = number 
     340    concat report, $S0 
     341    concat report, ' # TODO ' 
     342 
     343    $S0 = self.'reason'() 
     344    concat report, $S0 
     345 
     346    if passed goto REPORT 
     347    # Build long explanation why 
     348    report .= "\n\tFailed (TODO) test '" 
     349    $S0     = self.'description'() 
     350    report .= $S0 
     351    report .= "'" 
    350352 
    351353  REPORT: 
    352354    .return( report ) 
  • t/library/test_more.t

    diff --git a/t/library/test_more.t b/t/library/test_more.t
    index cb5cc3b..e2ddefa 100644
    a b  
    797797    .local pmc test 
    798798    test = new [ 'Test'; 'Builder' ] 
    799799 
    800     test_out( 'ok 8 # TODO passing test' ) 
     800    test_out( 'ok 8 # TODO todo reason' ) 
    801801    test.'todo'( 1, 'passing test', 'todo reason' ) 
    802802    test_test( 'todo test should pass, marked as TODO' ) 
    803803 
    804     test_out( 'not ok 9 # TODO failing test' ) 
     804    test_out( "not ok 9 # TODO todo reason\n\tFailed (TODO) test 'failing test'" ) 
    805805    test.'todo'( 0, 'failing test', 'todo reason' ) 
    806806    test_test( 'todo test should fail, marked as TODO' ) 
    807807 
    808     test_out( 'ok 10 # TODO passing test' ) 
     808    test_out( 'ok 10 # TODO todo reason' ) 
    809809    todo( 1, 'passing test', 'todo reason' ) 
    810810    test_test( 'todo test should pass, marked as TODO' ) 
    811811 
    812     test_out( 'not ok 11 # TODO failing test' ) 
     812    test_out( "not ok 11 # TODO todo reason\n\tFailed (TODO) test 'failing test'" ) 
    813813    todo( 0, 'failing test', 'todo reason' ) 
    814814    test_test( 'todo test should fail, marked as TODO' ) 
    815815 
    816     test_out( 'not ok 12 # TODO' ) 
     816    test_out( "not ok 12 # TODO \n\tFailed (TODO) test ''" ) 
    817817    todo( 0 ) 
    818818    test_test( 'todo test with no description or reason' ) 
    819819