steffen: server/kolab-horde-framework/kolab-horde-framework/Text_Diff/tests .cvsignore, NONE, 1.1 1.txt, NONE, 1.1 2.txt, NONE, 1.1 diff.phpt, NONE, 1.1 unified.phpt, NONE, 1.1
cvs at intevation.de
cvs at intevation.de
Fri Oct 14 16:33:15 CEST 2005
Author: steffen
Update of /kolabrepository/server/kolab-horde-framework/kolab-horde-framework/Text_Diff/tests
In directory doto:/tmp/cvs-serv28903/kolab-horde-framework/kolab-horde-framework/Text_Diff/tests
Added Files:
.cvsignore 1.txt 2.txt diff.phpt unified.phpt
Log Message:
Separated Horde Framework from kolab-resource-handlers
--- NEW FILE: .cvsignore ---
*.diff
*.exp
*.log
*.out
--- NEW FILE: 1.txt ---
This line is the same.
This line is different in 1.txt
This line is the same.
--- NEW FILE: 2.txt ---
This line is the same.
This line is different in 2.txt
This line is the same.
--- NEW FILE: diff.phpt ---
--TEST--
Text_Diff: Basic diff operation
--FILE--
<?php
include_once 'Diff.php';
include_once 'Diff/Renderer.php';
include_once 'Diff/Renderer/unified.php';
$lines1 = file(dirname(__FILE__) . '/1.txt');
$lines2 = file(dirname(__FILE__) . '/2.txt');
$diff = &new Text_Diff($lines1, $lines2);
print_r($diff);
--EXPECT--
text_diff Object
(
[_edits] => Array
(
[0] => text_diff_op_copy Object
(
[orig] => Array
(
[0] => This line is the same.
)
[final] => Array
(
[0] => This line is the same.
)
)
[1] => text_diff_op_delete Object
(
[orig] => Array
(
[0] => This line is different in 1.txt
)
[final] =>
)
[2] => text_diff_op_add Object
(
[orig] =>
[final] => Array
(
[0] => This line is different in 2.txt
)
)
[3] => text_diff_op_copy Object
(
[orig] => Array
(
[0] => This line is the same.
)
[final] => Array
(
[0] => This line is the same.
)
)
)
)
--- NEW FILE: unified.phpt ---
--TEST--
Text_Diff: Unified renderer
--FILE--
<?php
include_once 'Diff.php';
include_once 'Diff/Renderer.php';
include_once 'Diff/Renderer/unified.php';
$lines1 = file(dirname(__FILE__) . '/1.txt');
$lines2 = file(dirname(__FILE__) . '/2.txt');
$diff = &new Text_Diff($lines1, $lines2);
$renderer = &new Text_Diff_Renderer_unified();
echo $renderer->render($diff);
--EXPECT--
@@ -1,3 +1,3 @@
This line is the same.
-This line is different in 1.txt
+This line is different in 2.txt
This line is the same.
More information about the commits
mailing list