summaryrefslogtreecommitdiff
path: root/_test/cases/inc/DifferenceEngine.test.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2011-02-24 23:27:24 +0100
committerMichael Hamann <michael@content-space.de>2011-02-24 23:27:24 +0100
commitf77fc90de1e477b721442757cd7413f91cccc044 (patch)
tree2abb734dacf39419b96b6b70c65115de57228fc3 /_test/cases/inc/DifferenceEngine.test.php
parentb8c040db1fdc0eee80963e57d95a15fd3813912d (diff)
parentbd07158f0f2569ae470f980dd49d69b7f1fd2c49 (diff)
downloadrpg-f77fc90de1e477b721442757cd7413f91cccc044.tar.gz
rpg-f77fc90de1e477b721442757cd7413f91cccc044.tar.bz2
Merge branch 'master' into indexer_rewrite
Conflicts: inc/fulltext.php inc/indexer.php lib/exe/indexer.php
Diffstat (limited to '_test/cases/inc/DifferenceEngine.test.php')
-rw-r--r--_test/cases/inc/DifferenceEngine.test.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/_test/cases/inc/DifferenceEngine.test.php b/_test/cases/inc/DifferenceEngine.test.php
new file mode 100644
index 000000000..294f0e6e3
--- /dev/null
+++ b/_test/cases/inc/DifferenceEngine.test.php
@@ -0,0 +1,31 @@
+<?php
+require_once DOKU_INC.'inc/DifferenceEngine.php';
+
+class differenceengine_test extends UnitTestCase {
+
+ function test_white_between_words(){
+ // From FS#2161
+ global $lang;
+
+ $df = new Diff(explode("\n","example"),
+ explode("\n","example example2"));
+
+ $idf = new InlineDiffFormatter();
+ $tdf = new TableDiffFormatter();
+
+ $this->assertEqual($idf->format($df), '<tr><td colspan="4" class="diff-blockheader">@@ ' . $lang['line'] .
+ ' -1 +1 @@&nbsp;<span class="diff-deletedline"><del>' . $lang['deleted'] .
+ '</del></span>&nbsp;<span class="diff-addedline">' . $lang['created'] .
+ '</span></td></tr>
+
+<tr><td colspan="4">example&nbsp;<span class="diff-addedline">example2</span></td></tr>
+');
+ $this->assertEqual($tdf->format($df),
+ '<tr><td class="diff-blockheader" colspan="2">' . $lang['line'] . ' 1:</td>
+&nbsp; &nbsp;&nbsp;<td class="diff-blockheader" colspan="2">' . $lang['line'] . ' 1:</td>
+</tr>
+<tr><td>-</td><td class="diff-deletedline">example</td><td>+</td><td class="diff-addedline">example&nbsp;<strong>example2</strong></td></tr>
+');
+ }
+}
+//Setup VIM: ex: et ts=4 :