Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.3

Bug #12740 Failed assertion in Text_diff
Submitted: 2007-12-20 23:17 UTC
From: huddlerfrank Assigned: yunosh
Status: Closed Package: Text_Diff (version 0.3.1)
PHP Version: 5.2.4 OS: Windows
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 3 + 47 = ?

 
 [2007-12-20 23:17 UTC] huddlerfrank (Frank Farmer)
Description: ------------ Using the most recent build (0.3.1.), I get a failed assertion for many variations of the included test case. This issue appears to be similar to the one mentioned in: http://bugs.horde.org/ticket/?id=4997 as well as Pear bug #10423 However, after reading both bugs, I'm still not aware of a fix that works for my test case Test script: --------------- require_once "Text/Diff.php"; require_once "Text/Diff/Renderer.php"; require_once "Text/Diff/Renderer/inline.php"; $a = <<<QQ <li>The tax credit amounts to 30% of the cost of the system, with a maximum of 2,000. This credit is separate from the 500 home improvement credit.</li> <h3>Fuel Cells<a href="12341234213421341234123412341234123421341234213412342134213423" class="anchor" title="Link to this section"><br /> <li>Your fuel 123456789</li> QQ; $b = <<<QQ <li> of gas emissions by 2050</li> <li>Raise car fuel economy to 50 mpg by 2017</li> <li>Increase access to mass transit systems</li> QQ; $diff = new Text_Diff(explode("\n", $b), explode("\n", $a)); $renderer = new Text_Diff_Renderer_inline(); $renderer->render($diff); ?> Expected result: ---------------- [No output] Actual result: -------------- Warning: assert(): Assertion failed in C:\Program Files\PHP\PEAR\Text\Diff\Engine\native.php on line 205

Comments

 [2008-01-04 10:09 UTC] yunosh (Jan Schneider)
I can't reproduce this with the current code from CVS which isn't different from the 0.3.1 release functionally.
 [2008-01-04 10:10 UTC] yunosh (Jan Schneider)
Spoke too soon, this only happens with PHP 5.
 [2008-01-04 10:30 UTC] yunosh (Jan Schneider)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Text_Diff