sebastianbergmann / diff

Diff implementation
BSD 3-Clause "New" or "Revised" License
7.58k stars 85 forks source link

Difference or bug in 1.4.2 makes phpunit fail. #44

Closed ArturGoldyn closed 7 years ago

ArturGoldyn commented 7 years ago

Hi, I've been working on phpunit and found out there's a difference or bug. https://github.com/sebastianbergmann/phpunit/pull/2664 With package sebastian/diff 1.4.1 phpunit passes, and with package sebastian/diff 1.4.2 it fails.

Difference causes the first two failures. (remaining errors appear because I don't have TeamCity)

[arturdev@localhost phpunit]$ ./phpunit PHPUnit 6.2-g298838d by Sebastian Bergmann and contributors.

Runtime: PHP 7.0.18 with Xdebug 2.5.1 Configuration: /home/arturdev/projects/phpunit/phpunit.xml

............................................................. 61 / 1541 ( 3%) ............................................................. 122 / 1541 ( 7%) ............................................................. 183 / 1541 ( 11%) ............................................................. 244 / 1541 ( 15%) ............................................................. 305 / 1541 ( 19%) ............................................................. 366 / 1541 ( 23%) ............................................................. 427 / 1541 ( 27%) ............................................................. 488 / 1541 ( 31%) ............................................................. 549 / 1541 ( 35%) ............................................................. 610 / 1541 ( 39%) ............................................................. 671 / 1541 ( 43%) ............................................................. 732 / 1541 ( 47%) ........................F........F........................... 793 / 1541 ( 51%) ............................................................. 854 / 1541 ( 55%) ............................................................. 915 / 1541 ( 59%) ............................................................. 976 / 1541 ( 63%) ............................................................. 1037 / 1541 ( 67%) ............................................................. 1098 / 1541 ( 71%) ............................................................. 1159 / 1541 ( 75%) ............................................................. 1220 / 1541 ( 79%) ............................................................. 1281 / 1541 ( 83%) ............................................................. 1342 / 1541 ( 87%) ............................................................. 1403 / 1541 ( 91%) .S........................................................... 1464 / 1541 ( 95%) .....................FF..........F........................... 1525 / 1541 ( 98%) ................ 1541 / 1541 (100%)

Time: 37.03 seconds, Memory: 14.00MB

There were 5 failures:

1) PHPUnit\Framework\ConstraintTest::testConstraintIsEqual2 with data set #3 ('a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk', 'a\np\nc\nd\ne\nf\ng\nh\ni\nw\nk', 'Failed asserting that two str...n k'\n') Failed asserting that two strings are equal.

--- Expected +++ Actual @@ @@ 'custom message\n Failed asserting that two strings are equal.\n +\n @@ @@ +p\n\n -\n @@ @@\n i\n\n -j\n\n +w\n\n k'\n '

/home/arturdev/projects/phpunit/src/Framework/Constraint/IsEqual.php:140 /home/arturdev/projects/phpunit/src/Framework/Assert.php:2116 /home/arturdev/projects/phpunit/src/Framework/Assert.php:541 /home/arturdev/projects/phpunit/tests/Framework/ConstraintTest.php:850 /home/arturdev/projects/phpunit/src/Framework/TestCase.php:1056 /home/arturdev/projects/phpunit/src/Framework/TestCase.php:915 /home/arturdev/projects/phpunit/src/Framework/TestResult.php:696 /home/arturdev/projects/phpunit/src/Framework/TestCase.php:870 /home/arturdev/projects/phpunit/src/Framework/TestSuite.php:746 /home/arturdev/projects/phpunit/src/Framework/TestSuite.php:746 /home/arturdev/projects/phpunit/src/Framework/TestSuite.php:746 /home/arturdev/projects/phpunit/src/Framework/TestSuite.php:746 /home/arturdev/projects/phpunit/src/TextUI/TestRunner.php:534 /home/arturdev/projects/phpunit/src/TextUI/Command.php:209 /home/arturdev/projects/phpunit/src/TextUI/Command.php:140

2) PHPUnit\Framework\ConstraintTest::testConstraintIsEqual2 with data set #12 (stdClass Object (...), stdClass Object (...), 'Failed asserting that two obj...\n )\n') Failed asserting that two strings are equal.

--- Expected +++ Actual @@ @@ 'custom message\n Failed asserting that two objects are equal.\n +\n +\n @@ @@

  • 0 => 4\n -\n @@ @@\n 'foo' => 'a\n\n
  • b\n\n
  • p\n\n -\n @@ @@\n i\n\n
  • j\n\n
  • w\n\n k'\n )\n 'self' => stdClass Object (...)\n 'c' => stdClass Object (...)\n )\n '

/home/arturdev/projects/phpunit/src/Framework/Constraint/IsEqual.php:140 /home/arturdev/projects/phpunit/src/Framework/Assert.php:2116 /home/arturdev/projects/phpunit/src/Framework/Assert.php:541 /home/arturdev/projects/phpunit/tests/Framework/ConstraintTest.php:850 /home/arturdev/projects/phpunit/src/Framework/TestCase.php:1056 /home/arturdev/projects/phpunit/src/Framework/TestCase.php:915 /home/arturdev/projects/phpunit/src/Framework/TestResult.php:696 /home/arturdev/projects/phpunit/src/Framework/TestCase.php:870 /home/arturdev/projects/phpunit/src/Framework/TestSuite.php:746 /home/arturdev/projects/phpunit/src/Framework/TestSuite.php:746 /home/arturdev/projects/phpunit/src/Framework/TestSuite.php:746 /home/arturdev/projects/phpunit/src/Framework/TestSuite.php:746 /home/arturdev/projects/phpunit/src/TextUI/TestRunner.php:534 /home/arturdev/projects/phpunit/src/TextUI/Command.php:209 /home/arturdev/projects/phpunit/src/TextUI/Command.php:140

[...]

SpacePossum commented 7 years ago

Thanks for reporting. This should be resolved with https://github.com/sebastianbergmann/phpunit/pull/2687 Did you try updating both the packages?

ArturGoldyn commented 7 years ago

Thank you for suggestion, after merging master into feature branch all tests passed successfully.

SpacePossum commented 7 years ago

good to hear :) thanks for reporting back!