Author: chromatic Date: Sat Aug 9 21:11:06 2008 New Revision: 30154 Modified: trunk/runtime/parrot/library/Test/Builder/Tester.pir trunk/runtime/parrot/library/Test/More.pir trunk/t/library/test_more.t
Log: [library] Changed Received/Expected to Have/Want in Test::Builder and Test::More, per TAP discussion at Oslo QA Hackathon. Modified: trunk/runtime/parrot/library/Test/Builder/Tester.pir ============================================================================== --- trunk/runtime/parrot/library/Test/Builder/Tester.pir (original) +++ trunk/runtime/parrot/library/Test/Builder/Tester.pir Sat Aug 9 21:11:06 2008 @@ -422,20 +422,20 @@ REPORT_OUTPUT_MISMATCH: .local string diagnostic - diagnostic = "output mismatch\nexpected: " - concat diagnostic, expected_out_string - concat diagnostic, "\nreceived: " + diagnostic = "output mismatch\nhave: " concat diagnostic, received_out_string + concat diagnostic, "\nwant: " + concat diagnostic, expected_out_string concat diagnostic, "\n" test.'diag'( diagnostic ) eq diag_matches, 1, RETURN REPORT_DIAG_MISMATCH: - diagnostic = "diagnostic mismatch\nexpected: '" - concat diagnostic, expected_diag_string - concat diagnostic, "'\nreceived: '" + diagnostic = "diagnostic mismatch\nhave: '" concat diagnostic, received_diag_string + concat diagnostic, "'\nwant: '" + concat diagnostic, expected_diag_string concat diagnostic, "'\n" test.'diag'( diagnostic ) Modified: trunk/runtime/parrot/library/Test/More.pir ============================================================================== --- trunk/runtime/parrot/library/Test/More.pir (original) +++ trunk/runtime/parrot/library/Test/More.pir Sat Aug 9 21:11:06 2008 @@ -1008,9 +1008,9 @@ .param string expected .local string diagnostic - diagnostic = 'Received: ' + diagnostic = 'Have: ' diagnostic .= received - diagnostic .= "\nExpected: " + diagnostic .= "\nWant: " diagnostic .= expected .return( diagnostic ) Modified: trunk/t/library/test_more.t ============================================================================== --- trunk/t/library/test_more.t (original) +++ trunk/t/library/test_more.t Sat Aug 9 21:11:06 2008 @@ -60,8 +60,8 @@ test_test( 'passing test is() for ints') test_fail() - test_diag( 'Received: -100' ) - test_diag( 'Expected: 200' ) + test_diag( 'Have: -100' ) + test_diag( 'Want: 200' ) is( -100, 200 ) test_test( 'failing test is() for ints') @@ -71,8 +71,8 @@ test_fail( 'comparing two integers' ) is( -512, 5120, 'comparing two integers' ) - test_diag( 'Received: -512' ) - test_diag( 'Expected: 5120' ) + test_diag( 'Have: -512' ) + test_diag( 'Want: 5120' ) test_test( 'failing test is() for ints with description') test_pass() @@ -81,8 +81,8 @@ test_fail() is( 1.235, 5.321 ) - test_diag( 'Received: 1.235' ) - test_diag( 'Expected: 5.321' ) + test_diag( 'Have: 1.235' ) + test_diag( 'Want: 5.321' ) test_test( 'failing test is() for floats') test_pass( 'comparing two floats' ) @@ -91,8 +91,8 @@ test_fail( 'comparing two floats' ) is( 777.1, 888.8, 'comparing two floats' ) - test_diag( 'Received: 777.1' ) - test_diag( 'Expected: 888.8' ) + test_diag( 'Have: 777.1' ) + test_diag( 'Want: 888.8' ) test_test( 'failing test is() for floats with description') test_pass() @@ -101,8 +101,8 @@ test_fail() is( 'larry', 'bob' ) - test_diag( 'Received: larry' ) - test_diag( 'Expected: bob' ) + test_diag( 'Have: larry' ) + test_diag( 'Want: bob' ) test_test( 'failing test is() for strings') test_pass( 'comparing two strings' ) @@ -111,8 +111,8 @@ test_fail( 'comparing two strings' ) is( 'zeke', 'zelda', 'comparing two strings' ) - test_diag( 'Received: zeke' ) - test_diag( 'Expected: zelda' ) + test_diag( 'Have: zeke' ) + test_diag( 'Want: zelda' ) test_test( 'failing test is() for strings with description') .local pmc left @@ -129,8 +129,8 @@ right = new 'Integer' right = 0 test_fail() - test_diag( 'Received: zero' ) - test_diag( 'Expected: 0' ) + test_diag( 'Have: zero' ) + test_diag( 'Want: 0' ) is( left, right ) test_test( 'failing test is() for pmcs') @@ -143,12 +143,12 @@ .local string expected .local string hash_string - expected = 'Expected: ' + expected = 'Want: ' hash_string = right expected .= hash_string test_fail( 'comparing two pmcs' ) - test_diag( 'Received: 0' ) + test_diag( 'Have: 0' ) test_diag( expected ) is( left, right, 'comparing two pmcs' ) test_test( 'failing test is() for pmcs with description') @@ -160,8 +160,8 @@ test_test( 'passing test isnt() for ints') test_fail() - test_diag( 'Received: -100' ) - test_diag( 'Expected: not -100' ) + test_diag( 'Have: -100' ) + test_diag( 'Want: not -100' ) isnt( -100, -100 ) test_test( 'failing test is() for ints') @@ -171,8 +171,8 @@ test_fail( 'comparing two integers' ) isnt( -512, -512, 'comparing two integers' ) - test_diag( 'Received: -512' ) - test_diag( 'Expected: not -512' ) + test_diag( 'Have: -512' ) + test_diag( 'Want: not -512' ) test_test( 'failing test isnt() for ints with description') test_pass() @@ -181,8 +181,8 @@ test_fail() isnt( 1.235, 1.235 ) - test_diag( 'Received: 1.235' ) - test_diag( 'Expected: not 1.235' ) + test_diag( 'Have: 1.235' ) + test_diag( 'Want: not 1.235' ) test_test( 'failing test isnt() for floats') test_pass( 'comparing two floats' ) @@ -191,8 +191,8 @@ test_fail( 'comparing two floats' ) isnt( 80.8, 80.8, 'comparing two floats' ) - test_diag( 'Received: 80.8' ) - test_diag( 'Expected: not 80.8' ) + test_diag( 'Have: 80.8' ) + test_diag( 'Want: not 80.8' ) test_test( 'failing test isnt() for floats with description') test_pass() @@ -201,8 +201,8 @@ test_fail() isnt( 'larry', 'larry' ) - test_diag( 'Received: larry' ) - test_diag( 'Expected: not larry' ) + test_diag( 'Have: larry' ) + test_diag( 'Want: not larry' ) test_test( 'failing test isnt() for strings') test_pass( 'comparing two strings' ) @@ -211,8 +211,8 @@ test_fail( 'comparing two strings' ) isnt( 'larry', 'larry', 'comparing two strings' ) - test_diag( 'Received: larry' ) - test_diag( 'Expected: not larry' ) + test_diag( 'Have: larry' ) + test_diag( 'Want: not larry' ) test_test( 'failing test isnt() for strings with description') .local pmc left @@ -229,8 +229,8 @@ right = new 'String' right = 'zero' test_fail() - test_diag( 'Received: zero' ) - test_diag( 'Expected: not zero' ) + test_diag( 'Have: zero' ) + test_diag( 'Want: not zero' ) isnt( left, right ) test_test( 'failing test isnt() for pmcs') @@ -243,7 +243,7 @@ .local string expected .local string hash_string - expected = 'Expected: ' + expected = 'Want: ' hash_string = right expected .= hash_string