b2evolution PHP Cross Reference Blogging Systems

Source: /inc/_ext/phpsvnclient/ext/Diff/tests/xdiff.phpt - 24 lines - 634 bytes - Text - Print

   1  --TEST--
   2  Text_Diff: Text_Diff_Engine_xdiff test.
   3  --SKIPIF--
   4  <?php if (!extension_loaded('xdiff')) echo 'skip xdiff extension not installed'; ?>
   5  --FILE--
   6  <?php
   7  
   8  require_once 'PEAR.php';
   9  require_once 'Text/Diff.php';
  10  require_once 'Text/Diff/Renderer/unified.php';
  11  
  12  $lines1 = file(dirname(__FILE__) . '/1.txt');
  13  $lines2 = file(dirname(__FILE__) . '/2.txt');
  14  $diff = new Text_Diff('xdiff', array($lines1, $lines2));
  15  $renderer = new Text_Diff_Renderer_unified();
  16  echo $renderer->render($diff);
  17  
  18  ?>
  19  --EXPECT--
  20  @@ -1,3 +1,3 @@
  21   This line is the same.
  22  -This line is different in 1.txt
  23  +This line is different in 2.txt
  24   This line is the same.

title

Description

title

Description

title

Description

title

title

Body