# HG changeset patch # User Yuya Nishihara # Date 1453818432 -32400 # Node ID 4301b99126ef2be38718689182d16731d5f91ac3 # Parent 834d27c4655d183a736e6b522476765ecfc806ea test-highlight: factor out function that normalizes pygments output diff -r 834d27c4655d -r 4301b99126ef tests/test-highlight.t --- a/tests/test-highlight.t Tue Jan 26 23:26:05 2016 +0900 +++ b/tests/test-highlight.t Tue Jan 26 23:27:12 2016 +0900 @@ -10,6 +10,11 @@ $ hg init test $ cd test + $ filterhtml () { + > sed -e "s/class=\"k\"/class=\"kn\"/g" \ + > -e "s/class=\"mf\"/class=\"mi\"/g" + > } + create random Python file to exercise Pygments $ cat < primes.py @@ -57,8 +62,7 @@ hgweb filerevision, html - $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py') \ - > | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g" + $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py') | filterhtml 200 Script output follows @@ -190,8 +194,7 @@ hgweb fileannotate, html - $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py') \ - > | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g" + $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py') | filterhtml 200 Script output follows