Skip to content

Commit 6b9661c

Browse files
committed
Refactor sample text
Sample text A is altered to see difference between word and line level more clearly.
1 parent c27035a commit 6b9661c

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

tests/resources/a.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h1>This is demo content to show features of the php-diff package.</h1>
88
<h2>This line is removed from version2.</h2>
99
<h2>This line is the same for both versions.</h2>
10-
<h2>This line has inline differences between both versions.</h2>
10+
<h2>this line has inline differences between both versions.</h2>
1111
<h2>This line is the same for both versions.</h2>
1212
<h2>This line also has inline differences between both versions.</h2>
1313
<h2>This line is the same for both versions.</h2>

tests/resources/htmlInline.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@
5656
<th>10</th>
5757
<th>&nbsp;</th>
5858
<td class="Left">
59-
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line has <del>inline </del>differences between both versions.&lt;/h2&gt;</span>
59+
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;<del>this line has inline</del> differences between both versions.&lt;/h2&gt;</span>
6060
</td>
6161
</tr><tr>
6262
<th>&nbsp;</th>
6363
<th>9</th>
6464
<td class="Right">
65-
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line has <ins></ins>differences between both versions.&lt;/h2&gt;</span>
65+
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;<ins>This line has</ins> differences between both versions.&lt;/h2&gt;</span>
6666
</td>
6767
</tr></tbody><tbody class="ChangeEqual"><tr>
6868
<th>11</th>

tests/resources/htmlSideBySide.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@
8686
</tr></tbody><tbody class="ChangeReplace"><tr>
8787
<th>10</th>
8888
<td class="Left">
89-
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line has <del>inline </del>differences between both versions.&lt;/h2&gt;</span>
89+
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;<del>this line has inline</del> differences between both versions.&lt;/h2&gt;</span>
9090
</td>
9191
<th>9</th>
9292
<td class="Right">
93-
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line has <ins></ins>differences between both versions.&lt;/h2&gt;</span>
93+
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;<ins>This line has</ins> differences between both versions.&lt;/h2&gt;</span>
9494
</td>
9595
</tr></tbody><tbody class="ChangeEqual"><tr>
9696
<th>11</th>

tests/resources/htmlUnified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<span class="Differences DifferencesUnified"><span class="ChangeEqual"><span>&lt;html&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&lt;head&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta http-equiv="Content-type" content="text/html; charset=utf-8"/&gt;</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Hello <del>World</del>!&lt;/title&gt;</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Hello <ins>You</ins>!&lt;/title&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/head&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;This is demo content to show features of the php-diff package.&lt;/h1&gt;</span><br></span><span class="ChangeDelete"><span class="Left"><del>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is removed from version2.&lt;/h2&gt;</del></span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is the same for both versions.&lt;/h2&gt;</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line has <del>inline </del>differences between both versions.&lt;/h2&gt;</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line has <ins></ins>differences between both versions.&lt;/h2&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is the same for both versions.&lt;/h2&gt;</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line also has <del>inl</del>ine differences between both versions.&lt;/h2&gt;</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line also has <ins>InL</ins>ine differences between both versions.&lt;/h2&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is the same for both versions.&lt;/h2&gt;</span><br></span><span class="ChangeInsert"><span class="Right"><ins>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is added to version2.&lt;/h2&gt;</ins></span><br></span><span class="ChangeEqual"><span></span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It's also compatible with multibyte characters (like Chinese and emoji) as shown below:</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;另外我覺得那個評<del>價</del>的白色櫃子有點沒有必要欸。外觀我就不說了 ,怎麼連空間都那麼狹隘。不過倒是從這個地方看出所謂的“改革”</span><br><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you know what "<del>金槍魚罐頭</del>" means in Chinese?</span><br><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<del>🍏🍎</del>🙂</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;另外我覺得那個評<ins>鑑</ins>的白色櫃子有點沒有必要欸。外觀我就不說了 ,怎麼連空間都那麼狹隘。不過倒是從這個地方看出所謂的“改革”</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you know what "<ins>魚の缶詰</ins>" means in Chinese?</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ins>🍎🍏</ins>🙂</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/p&gt;</span><br><span></span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.&lt;/p&gt;</span><br></span><div class="Skipped" title="Equal lines collapsed!">&hellip;</div><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.&lt;/p&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.&lt;/p&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.&lt;/p&gt;</span><br></span><span class="ChangeReplace"><span class="Left"><del>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</del>&lt;h2&gt;This line also has inline differences between both versions. It's the whitespace in front.&lt;/h2&gt;</span><br><span class="Right"><ins>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</ins>&lt;h2&gt;This line also has inline differences between both versions. It's the whitespace in front.&lt;/h2&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is the same for both versions.&lt;/h2&gt;</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line also has inline differences between both versions<del>.</del>&lt;/h2&gt;</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line also has inline differences between both versions<ins>!</ins>&lt;/h2&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/body&gt;</span><br><span>&lt;/html&gt;</span><br><span></span><br></span></span>
1+
<span class="Differences DifferencesUnified"><span class="ChangeEqual"><span>&lt;html&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&lt;head&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta http-equiv="Content-type" content="text/html; charset=utf-8"/&gt;</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Hello <del>World</del>!&lt;/title&gt;</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Hello <ins>You</ins>!&lt;/title&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/head&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;This is demo content to show features of the php-diff package.&lt;/h1&gt;</span><br></span><span class="ChangeDelete"><span class="Left"><del>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is removed from version2.&lt;/h2&gt;</del></span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is the same for both versions.&lt;/h2&gt;</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;<del>this line has inline</del> differences between both versions.&lt;/h2&gt;</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;<ins>This line has</ins> differences between both versions.&lt;/h2&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is the same for both versions.&lt;/h2&gt;</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line also has <del>inl</del>ine differences between both versions.&lt;/h2&gt;</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line also has <ins>InL</ins>ine differences between both versions.&lt;/h2&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is the same for both versions.&lt;/h2&gt;</span><br></span><span class="ChangeInsert"><span class="Right"><ins>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is added to version2.&lt;/h2&gt;</ins></span><br></span><span class="ChangeEqual"><span></span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It's also compatible with multibyte characters (like Chinese and emoji) as shown below:</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;另外我覺得那個評<del>價</del>的白色櫃子有點沒有必要欸。外觀我就不說了 ,怎麼連空間都那麼狹隘。不過倒是從這個地方看出所謂的“改革”</span><br><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you know what "<del>金槍魚罐頭</del>" means in Chinese?</span><br><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<del>🍏🍎</del>🙂</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;另外我覺得那個評<ins>鑑</ins>的白色櫃子有點沒有必要欸。外觀我就不說了 ,怎麼連空間都那麼狹隘。不過倒是從這個地方看出所謂的“改革”</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you know what "<ins>魚の缶詰</ins>" means in Chinese?</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ins>🍎🍏</ins>🙂</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/p&gt;</span><br><span></span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.&lt;/p&gt;</span><br></span><div class="Skipped" title="Equal lines collapsed!">&hellip;</div><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.&lt;/p&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.&lt;/p&gt;</span><br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.&lt;/p&gt;</span><br></span><span class="ChangeReplace"><span class="Left"><del>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</del>&lt;h2&gt;This line also has inline differences between both versions. It's the whitespace in front.&lt;/h2&gt;</span><br><span class="Right"><ins>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</ins>&lt;h2&gt;This line also has inline differences between both versions. It's the whitespace in front.&lt;/h2&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line is the same for both versions.&lt;/h2&gt;</span><br></span><span class="ChangeReplace"><span class="Left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line also has inline differences between both versions<del>.</del>&lt;/h2&gt;</span><br><span class="Right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;This line also has inline differences between both versions<ins>!</ins>&lt;/h2&gt;</span><br></span><span class="ChangeEqual"><span>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/body&gt;</span><br><span>&lt;/html&gt;</span><br><span></span><br></span></span>

tests/resources/textContext.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<h1>This is demo content to show features of the php-diff package.</h1>
1010
- <h2>This line is removed from version2.</h2>
1111
<h2>This line is the same for both versions.</h2>
12-
! <h2>This line has inline differences between both versions.</h2>
12+
! <h2>this line has inline differences between both versions.</h2>
1313
<h2>This line is the same for both versions.</h2>
1414
! <h2>This line also has inline differences between both versions.</h2>
1515
<h2>This line is the same for both versions.</h2>

tests/resources/textInlineCli.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ x| <title>Hello -World-+You+!</title>
77
=| <h1>This is demo content to show features of the php-diff package.</h1>
88
-| <h2>This line is removed from version2.</h2>
99
=| <h2>This line is the same for both versions.</h2>
10-
x| <h2>This line has -inline -++differences between both versions.</h2>
10+
x| <h2>-this line has inline-+This line has+ differences between both versions.</h2>
1111
=| <h2>This line is the same for both versions.</h2>
1212
x| <h2>This line also has -inl-+InL+ine differences between both versions.</h2>
1313
=| <h2>This line is the same for both versions.</h2>

tests/resources/textUnified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<h1>This is demo content to show features of the php-diff package.</h1>
1010
- <h2>This line is removed from version2.</h2>
1111
<h2>This line is the same for both versions.</h2>
12-
- <h2>This line has inline differences between both versions.</h2>
12+
- <h2>this line has inline differences between both versions.</h2>
1313
+ <h2>This line has differences between both versions.</h2>
1414
<h2>This line is the same for both versions.</h2>
1515
- <h2>This line also has inline differences between both versions.</h2>

tests/resources/textUnifiedCli.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<h1>This is demo content to show features of the php-diff package.</h1>
1010
- <h2>This line is removed from version2.</h2>
1111
<h2>This line is the same for both versions.</h2>
12-
- <h2>This line has inline differences between both versions.</h2>
12+
- <h2>this line has inline differences between both versions.</h2>
1313
+ <h2>This line has differences between both versions.</h2>
1414
<h2>This line is the same for both versions.</h2>
1515
- <h2>This line also has inline differences between both versions.</h2>

0 commit comments

Comments
 (0)