Patchwork [2,of,3] test-highlight: expose bug in highlighting file with a formfeed

login
register
mail settings
Submitter Augie Fackler
Date Dec. 17, 2014, 4:16 p.m.
Message ID <00cf82b3d1453640f454.1418832970@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/7144/
State Accepted
Headers show

Comments

Augie Fackler - Dec. 17, 2014, 4:16 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1418765077 18000
#      Tue Dec 16 16:24:37 2014 -0500
# Node ID 00cf82b3d1453640f454d7f8d628e501228cf391
# Parent  4f724b91a9ddf395bd756988584f40af6de0cd88
test-highlight: expose bug in highlighting file with a formfeed

Patch

diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -186,6 +186,107 @@  hgweb filerevision, html
   </body>
   </html>
   
+file with exotic linebreak (currently broken: the
+last line of the file is missing)
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/with-ff.py') \
+  >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g"
+  200 Script output follows
+  
+  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
+  <head>
+  <link rel="icon" href="/static/hgicon.png" type="image/png" />
+  <meta name="robots" content="index, nofollow" />
+  <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
+  <script type="text/javascript" src="/static/mercurial.js"></script>
+  
+  <link rel="stylesheet" href="/highlightcss" type="text/css" />
+  <title>test: 561b8b6483ac with-ff.py</title>
+  </head>
+  <body>
+  
+  <div class="container">
+  <div class="menu">
+  <div class="logo">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" alt="mercurial" /></a>
+  </div>
+  <ul>
+  <li><a href="/shortlog/561b8b6483ac">log</a></li>
+  <li><a href="/graph/561b8b6483ac">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/bookmarks">bookmarks</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/561b8b6483ac">changeset</a></li>
+  <li><a href="/file/561b8b6483ac/">browse</a></li>
+  </ul>
+  <ul>
+  <li class="active">file</li>
+  <li><a href="/file/tip/with-ff.py">latest</a></li>
+  <li><a href="/diff/561b8b6483ac/with-ff.py">diff</a></li>
+  <li><a href="/comparison/561b8b6483ac/with-ff.py">comparison</a></li>
+  <li><a href="/annotate/561b8b6483ac/with-ff.py">annotate</a></li>
+  <li><a href="/log/561b8b6483ac/with-ff.py">file log</a></li>
+  <li><a href="/raw-file/561b8b6483ac/with-ff.py">raw</a></li>
+  </ul>
+  <ul>
+  <li><a href="/help">help</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
+  <h3>view with-ff.py @ 0:561b8b6483ac</h3>
+  
+  <form class="search" action="/log">
+  
+  <p><input name="rev" id="search1" type="text" size="30" /></p>
+  <div id="hint">Find changesets by keywords (author, files, the commit message), revision
+  number or hash, or <a href="/help/revsets">revset expression</a>.</div>
+  </form>
+  
+  <div class="description">a</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th class="author">author</th>
+   <td class="author">&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th class="date">date</th>
+   <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
+  </tr>
+  <tr>
+   <th class="author">parents</th>
+   <td class="author"></td>
+  </tr>
+  <tr>
+   <th class="author">children</th>
+   <td class="author"></td>
+  </tr>
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
+  <div class="sourcefirst"> line source</div>
+  <pre class="sourcelines stripes4 wrap">
+  <span id="l1"><span class="n">x</span> <span class="o">=</span> <span class="mi">1</span></span><a href="#l1"></a>
+  <span id="l2"><span class="n">x</span><span class="o">=</span><span class="mi">2</span></span><a href="#l2"></a></pre>
+  <div class="sourcelast"></div>
+  </div>
+  </div>
+  </div>
+  
+  <script type="text/javascript">process_dates()</script>
+  
+  
+  </body>
+  </html>
+  
+
 hgweb fileannotate, html
 
   $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/primes.py') \