Mercurial > hg-stable
changeset 27996:4301b99126ef
test-highlight: factor out function that normalizes pygments output
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 26 Jan 2016 23:27:12 +0900 |
parents | 834d27c4655d |
children | bc2dd19b9534 |
files | tests/test-highlight.t |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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 <<EOF > 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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> @@ -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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">