[diffoscope] 01/01: Make tests less brittle and remove pointless cases
Ximin Luo
infinity0 at debian.org
Tue May 30 21:06:35 CEST 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch experimental
in repository diffoscope.
commit 86094042841092125e42fac4cdc771f17acb17b6
Author: Ximin Luo <infinity0 at debian.org>
Date: Tue May 30 21:06:22 2017 +0200
Make tests less brittle and remove pointless cases
---
tests/data/index.html | 154 ---------------------
tests/data/output.html | 348 -----------------------------------------------
tests/test_presenters.py | 10 +-
3 files changed, 6 insertions(+), 506 deletions(-)
diff --git a/tests/data/index.html b/tests/data/index.html
deleted file mode 100644
index 82766c9..0000000
--- a/tests/data/index.html
+++ /dev/null
@@ -1,154 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8" />
- <meta http-equiv="x-ua-compatible" content="IE=edge">
- <meta name="referrer" content="no-referrer" />
- <meta name="generator" content="diffoscope" />
- <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADdgAAA3YBfdWCzAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAM8SURBVFiF7dZdaJZlGAfw3/O+e9XNjy3XllZzWImBxIpifqTgsmUHBSIeBNFBdRh0UHQ0xGdb66CFBIERZEFRQRRUw0HkQkLMYQSBdpCFWdgSP6jpNn2393k68Nn2bj3vXtb6UOh/cl/39b/u67mem/913zf/4z9GUDw5xNI8n5WIzW9m/QF2YluJmI8203mALzEvLWAerRs4Pz6vSIkZSlsYk0/GkaB0zEgyDgWMlijyWsJuS2fkQwu8pqpMTA0ypeiShG71Bp0rU8Q+A47MWEDg [...]
- <title>/usr/bin/pytest-3 -vv -r sxX tests/test_main.py tests/test_presenters.py</title>
- <style type="text/css">
- body.diffoscope {
- background: white;
- color: black;
- }
- .diffoscope .footer {
- font-size: small;
- }
- .diffoscope .difference {
- border: outset #888 1px;
- background: #E8E8E8;
- background: rgba(0,0,0,.1);
- padding: 0.5em;
- margin: 0.5em 0;
- }
- .diffoscope .difference table {
- table-layout: fixed;
- width: 100%;
- border: 0;
- }
- .diffoscope .difference th,
- .diffoscope .difference td {
- border: 0;
- }
- .diffoscope table.diff {
- border: 0;
- border-collapse:collapse;
- font-size:0.75em;
- font-family: 'Lucida Console', monospace;
- }
- .diffoscope table.diff tr:hover td {
- background: #FFFF00;
- }
- .diffoscope .line {
- color:#8080a0
- }
- .diffoscope th {
- background: black;
- color: white
- }
- .diffoscope .diffunmodified td {
- background: #D0D0E0
- }
- .diffoscope .diffhunk td {
- background: #A0A0A0
- }
- .diffoscope .diffadded td {
- background: #CCFFCC
- }
- .diffoscope .diffdeleted td {
- background: #FFCCCC
- }
- .diffoscope .diffchanged td {
- background: #FFFFA0
- }
- .diffoscope ins, del {
- background: #E0C880;
- text-decoration: none
- }
- .diffoscope .diffponct {
- color: #B08080
- }
- .diffoscope .comment {
- font-style: italic;
- }
- .diffoscope .source {
- font-weight: bold;
- }
- .diffoscope .error {
- border: solid black 1px;
- background: red;
- color: white;
- padding: 0.2em;
- }
- .diffoscope .anchor {
- margin-left: 0.5em;
- font-size: 80%;
- color: #333;
- text-decoration: none;
- display: none;
- }
- .diffoscope .diffheader:hover .anchor {
- display: inline;
- }
- .diffoscope table.diff tr.ondemand td {
- background: #f99;
- text-align: center;
- padding: 0.5em 0;
- }
- .diffoscope table.diff tr.ondemand:hover td {
- background: #faa;
- cursor: pointer;
- }
- .diffoscope .diffcontrol {
- float: left;
- margin-right: 0.3em;
- cursor: pointer;
- display: none; /* currently, only available in html-dir output where jquery is enabled */
- }
- .diffoscope .diffcontrol-double {
- line-height: 200%;
- }
- .diffoscope .colines {
- width: 3em;
- }
- .diffoscope .coldiff {
- width: 99%;
- }
- </style>
-
-</head>
-<body class="diffoscope">
-<div class="difference"><div class="diffheader"><div class="diffcontrol diffcontrol-double">[−]</div><div><span class="source">test1.tar</span> vs.</div><div><span class="source">test2.tar</span> <a class="anchor" href="#" name="">¶</a></div></div><div class="difference"><div class="diffheader"><div class="diffcontrol">[−]</div><div><span class="source">file list</span> <a class="anchor" href="#file-list" name="file-list">¶</a></div></div><table class="diff">
-<colgroup><col class="colines"/><col class="coldiff"/>
-<col class="colines"/><col class="coldiff"/></colgroup>
-<tr class="diffhunk"><td colspan="2">Offset 1, 4 lines modified</td><td colspan="2">Offset 1, 4 lines modified</td></tr>
-<tr class="diffchanged"><td class="diffline">1 </td><td class="diffpresent">drwxr-xr-x<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct" [...]
-<tr class="diffchanged"><td class="diffline">2 </td><td class="diffpresent">-rw-r--r--<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffpo [...]
-<tr class="diffchanged"><td class="diffline">3 </td><td class="diffpresent">crw-r--r--<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>root<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span> [...]
-<tr class="diffchanged"><td class="diffline">4 </td><td class="diffpresent">lrwxrwxrwx<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">· [...]
-</table></div><div class="difference"><div class="diffheader"><div class="diffcontrol">[−]</div><div><span class="source">dir/text</span> <a class="anchor" href="#dir-text" name="dir-text">¶</a></div></div><table class="diff">
-<colgroup><col class="colines"/><col class="coldiff"/>
-<col class="colines"/><col class="coldiff"/></colgroup>
-<tr class="diffhunk"><td colspan="2">Offset 1, 6 lines modified</td><td colspan="2">Offset 1, 12 lines modified</td></tr>
-<tr class="diffadded"><td colspan="2"> </td><td class="diffline">1 </td><td class="diffpresent">A<span class="diffponct">·</span>common<span class="diffponct">·</span>form<span class="diffponct">·</span>of<span class="diffponct">·</span>lorem<span class="diffponct">·</span>ipsum<span class="diffponct">·</span>reads:</td></tr>
-<tr class="diffadded"><td colspan="2"> </td><td colspan="2"> </td></tr>
-<tr class="diffunmodified"><td class="diffline">1 </td><td class="diffpresent">Lorem<span class="diffponct">·</span>ipsum<span class="diffponct">·</span>dolor<span class="diffponct">·</span>sit<span class="diffponct">·</span>amet,<span class="diffponct">·</span>consectetur<span class="diffponct">·</span>adipiscing<span class="diffponct">·</span>elit,<span class="diffponct">·</span>sed<span class="diffponct">·</span>do<span class="diffponct">·</span>eiusmod<span class="diffpon [...]
-<tr class="diffunmodified"><td class="diffline">2 </td><td class="diffpresent">incididunt<span class="diffponct">·</span>ut<span class="diffponct">·</span>labore<span class="diffponct">·</span>et<span class="diffponct">·</span>dolore<span class="diffponct">·</span>magna<span class="diffponct">·</span>aliqua.<span class="diffponct">·</span>Ut<span class="diffponct">·</span>enim<span class="diffponct">·</span>ad<span class="diffponct">·</span>minim<span class="diffponct">·</span [...]
-<tr class="diffunmodified"><td class="diffline">3 </td><td class="diffpresent">nostrud<span class="diffponct">·</span>exercitation<span class="diffponct">·</span>ullamco<span class="diffponct">·</span>laboris<span class="diffponct">·</span>nisi<span class="diffponct">·</span>ut<span class="diffponct">·</span>aliquip<span class="diffponct">·</span>ex<span class="diffponct">·</span>ea<span class="diffponct">·</span>commodo<span class="diffponct">·</span>consequat.</td><td class= [...]
-<tr class="diffunmodified"><td class="diffline">4 </td><td class="diffpresent">Duis<span class="diffponct">·</span>aute<span class="diffponct">·</span>irure<span class="diffponct">·</span>dolor<span class="diffponct">·</span>in<span class="diffponct">·</span>reprehenderit<span class="diffponct">·</span>in<span class="diffponct">·</span>voluptate<span class="diffponct">·</span>velit<span class="diffponct">·</span>esse<span class="diffponct">·</span>cillum<span class="diffponct"> [...]
-<tr class="diffunmodified"><td class="diffline">5 </td><td class="diffpresent">fugiat<span class="diffponct">·</span>nulla<span class="diffponct">·</span>pariatur.<span class="diffponct">·</span>Excepteur<span class="diffponct">·</span>sint<span class="diffponct">·</span>occaecat<span class="diffponct">·</span>cupidatat<span class="diffponct">·</span>non<span class="diffponct">·</span>proident,<span class="diffponct">·</span>sunt<span class="diffponct">·</span>in</td><td clas [...]
-<tr class="diffunmodified"><td class="diffline">6 </td><td class="diffpresent">culpa<span class="diffponct">·</span>qui<span class="diffponct">·</span>officia<span class="diffponct">·</span>deserunt<span class="diffponct">·</span>mollit<span class="diffponct">·</span>anim<span class="diffponct">·</span>id<span class="diffponct">·</span>est<span class="diffponct">·</span>laborum.</td><td class="diffline">7 </td><td class="diffpresent">culpa<span class="diffponct">·</span>qui<spa [...]
-<tr class="diffadded"><td colspan="2"> </td><td colspan="2"> </td></tr>
-<tr class="diffadded"><td colspan="2"> </td><td class="diffline">8 </td><td class="diffpresent">"Lorem<span class="diffponct">·</span>ipsum"<span class="diffponct">·</span>text<span class="diffponct">·</span>is<span class="diffponct">·</span>derived<span class="diffponct">·</span>from<span class="diffponct">·</span>sections<span class="diffponct">·</span>1.10.32--3<span class="diffponct">·</span>of<span class="diffponct">·</span>Cicero's<span class="diffponct" [...]
-<tr class="diffadded"><td colspan="2"> </td><td class="diffline">9 </td><td class="diffpresent">bonorum<span class="diffponct">·</span>et<span class="diffponct">·</span>malorum<span class="diffponct">·</span>(On<span class="diffponct">·</span>the<span class="diffponct">·</span>Ends<span class="diffponct">·</span>of<span class="diffponct">·</span>Goods<span class="diffponct">·</span>and<span class="diffponct">·</span>Evils,<span class="diffponct">·</span>or<span class="diffponc [...]
-<tr class="diffadded"><td colspan="2"> </td><td class="diffline">10 </td><td class="diffpresent">The<span class="diffponct">·</span>Purposes<span class="diffponct">·</span>of<span class="diffponct">·</span>Good<span class="diffponct">·</span>and<span class="diffponct">·</span>Evil).</td></tr>
-</table></div><div class="difference"><div class="diffheader"><div class="diffcontrol">[−]</div><div><span class="source">dir/link</span> <a class="anchor" href="#dir-link" name="dir-link">¶</a></div><div class="comment">symlink</div></div><table class="diff">
-<colgroup><col class="colines"/><col class="coldiff"/>
-<col class="colines"/><col class="coldiff"/></colgroup>
-<tr class="diffhunk"><td colspan="2">Offset 1, 1 lines modified</td><td colspan="2">Offset 1, 1 lines modified</td></tr>
-<tr class="diffchanged"><td class="diffline">1 </td><td class="diffpresent">destination:<span class="diffponct">·</span>broken</td><td class="diffline">1 </td><td class="diffpresent">destination:<span class="diffponct">·</span><ins>really-</ins>broken</td></tr>
-</table></div></div>
-<div class="footer">Generated by <a href="https://diffoscope.org" rel="noopener noreferrer" target="_blank">diffoscope</a> 69</div>
-</body>
-</html>
diff --git a/tests/data/output.html b/tests/data/output.html
deleted file mode 100644
index 7d0ca31..0000000
--- a/tests/data/output.html
+++ /dev/null
@@ -1,348 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8" />
- <meta http-equiv="x-ua-compatible" content="IE=edge">
- <meta name="referrer" content="no-referrer" />
- <meta name="generator" content="diffoscope" />
- <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADdgAAA3YBfdWCzAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAM8SURBVFiF7dZdaJZlGAfw3/O+e9XNjy3XllZzWImBxIpifqTgsmUHBSIeBNFBdRh0UHQ0xGdb66CFBIERZEFRQRRUw0HkQkLMYQSBdpCFWdgSP6jpNn2393k68Nn2bj3vXtb6UOh/cl/39b/u67mem/913zf/4z9GUDw5xNI8n5WIzW9m/QF2YluJmI8203mALzEvLWAerRs4Pz6vSIkZSlsYk0/GkaB0zEgyDgWMlijyWsJuS2fkQwu8pqpMTA0ypeiShG71Bp0rU8Q+A47MWEDg [...]
- <title>/usr/bin/pytest-3 -vv -r sxX tests/test_main.py tests/test_presenters.py</title>
- <style type="text/css">
- body.diffoscope {
- background: white;
- color: black;
- }
- .diffoscope .footer {
- font-size: small;
- }
- .diffoscope .difference {
- border: outset #888 1px;
- background: #E8E8E8;
- background: rgba(0,0,0,.1);
- padding: 0.5em;
- margin: 0.5em 0;
- }
- .diffoscope .difference table {
- table-layout: fixed;
- width: 100%;
- border: 0;
- }
- .diffoscope .difference th,
- .diffoscope .difference td {
- border: 0;
- }
- .diffoscope table.diff {
- border: 0;
- border-collapse:collapse;
- font-size:0.75em;
- font-family: 'Lucida Console', monospace;
- }
- .diffoscope table.diff tr:hover td {
- background: #FFFF00;
- }
- .diffoscope .line {
- color:#8080a0
- }
- .diffoscope th {
- background: black;
- color: white
- }
- .diffoscope .diffunmodified td {
- background: #D0D0E0
- }
- .diffoscope .diffhunk td {
- background: #A0A0A0
- }
- .diffoscope .diffadded td {
- background: #CCFFCC
- }
- .diffoscope .diffdeleted td {
- background: #FFCCCC
- }
- .diffoscope .diffchanged td {
- background: #FFFFA0
- }
- .diffoscope ins, del {
- background: #E0C880;
- text-decoration: none
- }
- .diffoscope .diffponct {
- color: #B08080
- }
- .diffoscope .comment {
- font-style: italic;
- }
- .diffoscope .source {
- font-weight: bold;
- }
- .diffoscope .error {
- border: solid black 1px;
- background: red;
- color: white;
- padding: 0.2em;
- }
- .diffoscope .anchor {
- margin-left: 0.5em;
- font-size: 80%;
- color: #333;
- text-decoration: none;
- display: none;
- }
- .diffoscope .diffheader:hover .anchor {
- display: inline;
- }
- .diffoscope table.diff tr.ondemand td {
- background: #f99;
- text-align: center;
- padding: 0.5em 0;
- }
- .diffoscope table.diff tr.ondemand:hover td {
- background: #faa;
- cursor: pointer;
- }
- .diffoscope .diffcontrol {
- float: left;
- margin-right: 0.3em;
- cursor: pointer;
- display: none; /* currently, only available in html-dir output where jquery is enabled */
- }
- .diffoscope .diffcontrol-double {
- line-height: 200%;
- }
- .diffoscope .colines {
- width: 3em;
- }
- .diffoscope .coldiff {
- width: 99%;
- }
- </style>
-
-</head>
-<body class="diffoscope">
-
-<div class="difference">
-<div class="diffheader">
-<div class="diffcontrol diffcontrol-double">[−]</div>
-<div><span class="source">test1.tar</span> vs.</div>
-<div><span class="source">test2.tar</span>
- <a class="anchor" href="#" name="">¶</a>
-</div>
-</div>
-<div class="difference">
-<div class="diffheader">
-<div class="diffcontrol">[−]</div>
-<div><span class="source">file list</span>
- <a class="anchor" href="#file-list" name="file-list">¶</a>
-</div>
-</div>
-<table class="diff">
-<colgroup><col class="colines"/><col class="coldiff"/>
-<col class="colines"/><col class="coldiff"/></colgroup>
-
-<tr class="diffhunk"><td colspan="2">Offset 1, 4 lines modified</td>
-<td colspan="2">Offset 1, 4 lines modified</td></tr>
-
-<tr class="diffchanged">
-<td class="diffline">1 </td>
-<td class="diffpresent">
-drwxr-xr-x<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span> [...]
-</td>
-<td class="diffline">1 </td>
-<td class="diffpresent">
-drwxr-xr-x<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span> [...]
-</td>
-</tr>
-
-<tr class="diffchanged">
-<td class="diffline">2 </td>
-<td class="diffpresent">
--rw-r--r--<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</sp [...]
-</td>
-<td class="diffline">2 </td>
-<td class="diffpresent">
--rw-r--r--<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</sp [...]
-</td>
-</tr>
-
-<tr class="diffchanged">
-<td class="diffline">3 </td>
-<td class="diffpresent">
-crw-r--r--<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>root<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(0)<span class="diffponct">·</span>root<s [...]
-</td>
-<td class="diffline">3 </td>
-<td class="diffpresent">
-crw-r--r--<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>root<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(0)<span class="diffponct">·</span>root<s [...]
-</td>
-</tr>
-
-<tr class="diffchanged">
-<td class="diffline">4 </td>
-<td class="diffpresent">
-lrwxrwxrwx<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><s [...]
-</td>
-<td class="diffline">4 </td>
-<td class="diffpresent">
-lrwxrwxrwx<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>0<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span>(1000)<span class="diffponct">·</span>lunar<span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><span class="diffponct">·</span><s [...]
-</td>
-</tr>
-
-</table>
-</div>
-<div class="difference">
-<div class="diffheader">
-<div class="diffcontrol">[−]</div>
-<div><span class="source">dir/text</span>
- <a class="anchor" href="#dir-text" name="dir-text">¶</a>
-</div>
-</div>
-<table class="diff">
-<colgroup><col class="colines"/><col class="coldiff"/>
-<col class="colines"/><col class="coldiff"/></colgroup>
-
-<tr class="diffhunk"><td colspan="2">Offset 1, 6 lines modified</td>
-<td colspan="2">Offset 1, 12 lines modified</td></tr>
-
-<tr class="diffadded">
-<td colspan="2"> </td>
-<td class="diffline">1 </td>
-<td class="diffpresent">
-A<span class="diffponct">·</span>common<span class="diffponct">·</span>form<span class="diffponct">·</span>of<span class="diffponct">·</span>lorem<span class="diffponct">·</span>ipsum<span class="diffponct">·</span>reads:
-</td>
-</tr>
-
-<tr class="diffadded">
-<td colspan="2"> </td>
-<td colspan="2"> </td>
-</tr>
-
-<tr class="diffunmodified">
-<td class="diffline">1 </td>
-<td class="diffpresent">
-Lorem<span class="diffponct">·</span>ipsum<span class="diffponct">·</span>dolor<span class="diffponct">·</span>sit<span class="diffponct">·</span>amet,<span class="diffponct">·</span>consectetur<span class="diffponct">·</span>adipiscing<span class="diffponct">·</span>elit,<span class="diffponct">·</span>sed<span class="diffponct">·</span>do<span class="diffponct">·</span>eiusmod<span class="diffponct">·</span>tempor
-</td>
-<td class="diffline">2 </td>
-<td class="diffpresent">
-Lorem<span class="diffponct">·</span>ipsum<span class="diffponct">·</span>dolor<span class="diffponct">·</span>sit<span class="diffponct">·</span>amet,<span class="diffponct">·</span>consectetur<span class="diffponct">·</span>adipiscing<span class="diffponct">·</span>elit,<span class="diffponct">·</span>sed<span class="diffponct">·</span>do<span class="diffponct">·</span>eiusmod<span class="diffponct">·</span>tempor
-</td>
-</tr>
-
-<tr class="diffunmodified">
-<td class="diffline">2 </td>
-<td class="diffpresent">
-incididunt<span class="diffponct">·</span>ut<span class="diffponct">·</span>labore<span class="diffponct">·</span>et<span class="diffponct">·</span>dolore<span class="diffponct">·</span>magna<span class="diffponct">·</span>aliqua.<span class="diffponct">·</span>Ut<span class="diffponct">·</span>enim<span class="diffponct">·</span>ad<span class="diffponct">·</span>minim<span class="diffponct">·</span>veniam,<span class="diffponct">·</span>quis
-</td>
-<td class="diffline">3 </td>
-<td class="diffpresent">
-incididunt<span class="diffponct">·</span>ut<span class="diffponct">·</span>labore<span class="diffponct">·</span>et<span class="diffponct">·</span>dolore<span class="diffponct">·</span>magna<span class="diffponct">·</span>aliqua.<span class="diffponct">·</span>Ut<span class="diffponct">·</span>enim<span class="diffponct">·</span>ad<span class="diffponct">·</span>minim<span class="diffponct">·</span>veniam,<span class="diffponct">·</span>quis
-</td>
-</tr>
-
-<tr class="diffunmodified">
-<td class="diffline">3 </td>
-<td class="diffpresent">
-nostrud<span class="diffponct">·</span>exercitation<span class="diffponct">·</span>ullamco<span class="diffponct">·</span>laboris<span class="diffponct">·</span>nisi<span class="diffponct">·</span>ut<span class="diffponct">·</span>aliquip<span class="diffponct">·</span>ex<span class="diffponct">·</span>ea<span class="diffponct">·</span>commodo<span class="diffponct">·</span>consequat.
-</td>
-<td class="diffline">4 </td>
-<td class="diffpresent">
-nostrud<span class="diffponct">·</span>exercitation<span class="diffponct">·</span>ullamco<span class="diffponct">·</span>laboris<span class="diffponct">·</span>nisi<span class="diffponct">·</span>ut<span class="diffponct">·</span>aliquip<span class="diffponct">·</span>ex<span class="diffponct">·</span>ea<span class="diffponct">·</span>commodo<span class="diffponct">·</span>consequat.
-</td>
-</tr>
-
-<tr class="diffunmodified">
-<td class="diffline">4 </td>
-<td class="diffpresent">
-Duis<span class="diffponct">·</span>aute<span class="diffponct">·</span>irure<span class="diffponct">·</span>dolor<span class="diffponct">·</span>in<span class="diffponct">·</span>reprehenderit<span class="diffponct">·</span>in<span class="diffponct">·</span>voluptate<span class="diffponct">·</span>velit<span class="diffponct">·</span>esse<span class="diffponct">·</span>cillum<span class="diffponct">·</span>dolore<span class="diffponct">·</span>eu
-</td>
-<td class="diffline">5 </td>
-<td class="diffpresent">
-Duis<span class="diffponct">·</span>aute<span class="diffponct">·</span>irure<span class="diffponct">·</span>dolor<span class="diffponct">·</span>in<span class="diffponct">·</span>reprehenderit<span class="diffponct">·</span>in<span class="diffponct">·</span>voluptate<span class="diffponct">·</span>velit<span class="diffponct">·</span>esse<span class="diffponct">·</span>cillum<span class="diffponct">·</span>dolore<span class="diffponct">·</span>eu
-</td>
-</tr>
-
-<tr class="diffunmodified">
-<td class="diffline">5 </td>
-<td class="diffpresent">
-fugiat<span class="diffponct">·</span>nulla<span class="diffponct">·</span>pariatur.<span class="diffponct">·</span>Excepteur<span class="diffponct">·</span>sint<span class="diffponct">·</span>occaecat<span class="diffponct">·</span>cupidatat<span class="diffponct">·</span>non<span class="diffponct">·</span>proident,<span class="diffponct">·</span>sunt<span class="diffponct">·</span>in
-</td>
-<td class="diffline">6 </td>
-<td class="diffpresent">
-fugiat<span class="diffponct">·</span>nulla<span class="diffponct">·</span>pariatur.<span class="diffponct">·</span>Excepteur<span class="diffponct">·</span>sint<span class="diffponct">·</span>occaecat<span class="diffponct">·</span>cupidatat<span class="diffponct">·</span>non<span class="diffponct">·</span>proident,<span class="diffponct">·</span>sunt<span class="diffponct">·</span>in
-</td>
-</tr>
-
-<tr class="diffunmodified">
-<td class="diffline">6 </td>
-<td class="diffpresent">
-culpa<span class="diffponct">·</span>qui<span class="diffponct">·</span>officia<span class="diffponct">·</span>deserunt<span class="diffponct">·</span>mollit<span class="diffponct">·</span>anim<span class="diffponct">·</span>id<span class="diffponct">·</span>est<span class="diffponct">·</span>laborum.
-</td>
-<td class="diffline">7 </td>
-<td class="diffpresent">
-culpa<span class="diffponct">·</span>qui<span class="diffponct">·</span>officia<span class="diffponct">·</span>deserunt<span class="diffponct">·</span>mollit<span class="diffponct">·</span>anim<span class="diffponct">·</span>id<span class="diffponct">·</span>est<span class="diffponct">·</span>laborum.
-</td>
-</tr>
-
-<tr class="diffadded">
-<td colspan="2"> </td>
-<td colspan="2"> </td>
-</tr>
-
-<tr class="diffadded">
-<td colspan="2"> </td>
-<td class="diffline">8 </td>
-<td class="diffpresent">
-"Lorem<span class="diffponct">·</span>ipsum"<span class="diffponct">·</span>text<span class="diffponct">·</span>is<span class="diffponct">·</span>derived<span class="diffponct">·</span>from<span class="diffponct">·</span>sections<span class="diffponct">·</span>1.10.32--3<span class="diffponct">·</span>of<span class="diffponct">·</span>Cicero's<span class="diffponct">·</span>De<span class="diffponct">·</span>finibus
-</td>
-</tr>
-
-<tr class="diffadded">
-<td colspan="2"> </td>
-<td class="diffline">9 </td>
-<td class="diffpresent">
-bonorum<span class="diffponct">·</span>et<span class="diffponct">·</span>malorum<span class="diffponct">·</span>(On<span class="diffponct">·</span>the<span class="diffponct">·</span>Ends<span class="diffponct">·</span>of<span class="diffponct">·</span>Goods<span class="diffponct">·</span>and<span class="diffponct">·</span>Evils,<span class="diffponct">·</span>or<span class="diffponct">·</span>alternatively<span class="diffponct">·</span>[About]
-</td>
-</tr>
-
-<tr class="diffadded">
-<td colspan="2"> </td>
-<td class="diffline">10 </td>
-<td class="diffpresent">
-The<span class="diffponct">·</span>Purposes<span class="diffponct">·</span>of<span class="diffponct">·</span>Good<span class="diffponct">·</span>and<span class="diffponct">·</span>Evil).
-</td>
-</tr>
-
-</table>
-</div>
-<div class="difference">
-<div class="diffheader">
-<div class="diffcontrol">[−]</div>
-<div><span class="source">dir/link</span>
- <a class="anchor" href="#dir-link" name="dir-link">¶</a>
-</div>
-<div class="comment">symlink</div>
-</div>
-<table class="diff">
-<colgroup><col class="colines"/><col class="coldiff"/>
-<col class="colines"/><col class="coldiff"/></colgroup>
-
-<tr class="diffhunk"><td colspan="2">Offset 1, 1 lines modified</td>
-<td colspan="2">Offset 1, 1 lines modified</td></tr>
-
-<tr class="diffchanged">
-<td class="diffline">1 </td>
-<td class="diffpresent">
-destination:<span class="diffponct">·</span>broken
-</td>
-<td class="diffline">1 </td>
-<td class="diffpresent">
-destination:<span class="diffponct">·</span><ins>really-</ins>broken
-</td>
-</tr>
-
-</table>
-</div>
-</div>
-
-<div class="footer">Generated by <a href="https://diffoscope.org" rel="noopener noreferrer" target="_blank">diffoscope</a> 69</div>
-</body>
-</html>
-
diff --git a/tests/test_presenters.py b/tests/test_presenters.py
index 71f8226..b604cda 100644
--- a/tests/test_presenters.py
+++ b/tests/test_presenters.py
@@ -112,7 +112,8 @@ def test_html_option_with_file(tmpdir, capsys):
assert out == ''
with open(report_path, 'r', encoding='utf-8') as f:
- assert extract_body(f.read()) == extract_body(get_data('output.html'))
+ body = extract_body(f.read())
+ assert body.count('div class="difference"') == 4
def test_html_visuals(tmpdir, capsys):
report_path = str(tmpdir.join('report.html'))
@@ -132,12 +133,13 @@ def test_htmldir_option(tmpdir, capsys):
assert out == ''
assert os.path.isdir(html_dir)
with open(os.path.join(html_dir, 'index.html'), 'r', encoding='utf-8') as f:
- assert extract_body(f.read()) == extract_body(get_data('index.html'))
+ body = extract_body(f.read())
+ assert body.count('div class="difference"') == 4
def test_html_option_with_stdout(capsys):
- out = run(capsys, '--html', '-')
+ body = extract_body(run(capsys, '--html', '-'))
- assert extract_body(out) == extract_body(get_data('output.html'))
+ assert body.count('div class="difference"') == 4
def test_limited_print():
fake = lambda x: None
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list