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

Bug #10423 Assert on line 202 (file: native.php) fails for no apparent reason
Submitted: 2007-03-20 05:36 UTC Modified: 2007-05-03 09:41 UTC
From: merc Assigned: chagenbu
Status: Closed Package: Text_Diff (version 0.2.1)
PHP Version: 5.1.0 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2007-03-20 05:36 UTC] merc (Tony Mobily)
Description: ------------ Hi, I am developing a Drupal module using your fantastic library. *sometimes*, the assertion on line 202 of the file Text/Diff/Engine/native.php fails. I managed to find a workable example. This is the file '1': ---------------------------------------- <p>Yankeetown is a small town.</p> <figure> <caption>Welcome to Yankeetown</caption> <file_name>town_limit.jpg</file_name> </figure> <p>While I have spent the last ten years moving around the world</p> ----------------------------------------- This is the file '2': ------------------------------------------- <p>Yankeetown is a small town.</p> <p>While I have spent the last ten years moving around the world</p> -------------------------------------------- The script that follows will simply use the engine to compare the two - and it will give warnings... Test script: --------------- <?php $r1=file_get_contents('1'); $r2=file_get_contents('2'); include_once 'Text/Diff.php'; include_once 'Text/Diff/Renderer.php'; include_once 'Text/Diff/Renderer/inline.php'; ini_set("include_path", "."); $source = explode("\n", $r2); $target = explode("\n", $r1); $diff = &new Text_Diff($target,$source); $renderer = &new Text_Diff_Renderer_inline(); ?> Expected result: ---------------- A blank screen Actual result: -------------- Warning: assert(): Assertion failed in /media/sda3/home/drupal/htdocs/modules/diff/Text/Diff/Engine/native.php on line 202 Warning: assert(): Assertion failed in /media/sda3/home/drupal/htdocs/modules/diff/Text/Diff/Engine/native.php on line 202

Comments

 [2007-05-03 09:41 UTC] chagenbu (Chuck Hagenbuch)