tests/test-highlight.t
changeset 25472 4d2b9b304ad0
parent 25136 99d01d288c37
child 25474 8c14f87bd0ae
equal deleted inserted replaced
25470:378a8e700e02 25472:4d2b9b304ad0
    53   $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
    53   $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
    54   $ cat hg.pid >> $DAEMON_PIDS
    54   $ cat hg.pid >> $DAEMON_PIDS
    55 
    55 
    56 hgweb filerevision, html
    56 hgweb filerevision, html
    57 
    57 
    58   $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/primes.py') \
    58   $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py') \
    59   >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g"
    59   >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g"
    60   200 Script output follows
    60   200 Script output follows
    61   
    61   
    62   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    62   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    63   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
    63   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
   183   </html>
   183   </html>
   184   
   184   
   185 
   185 
   186 hgweb fileannotate, html
   186 hgweb fileannotate, html
   187 
   187 
   188   $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/primes.py') \
   188   $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py') \
   189   >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g"
   189   >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g"
   190   200 Script output follows
   190   200 Script output follows
   191   
   191   
   192   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
   192   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
   193   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
   193   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
   513   </html>
   513   </html>
   514   
   514   
   515 
   515 
   516 hgweb fileannotate, raw
   516 hgweb fileannotate, raw
   517 
   517 
   518   $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/primes.py?style=raw') \
   518   $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py?style=raw') \
   519   >     | sed "s/test@//" > a
   519   >     | sed "s/test@//" > a
   520   $ echo "200 Script output follows" > b
   520   $ echo "200 Script output follows" > b
   521   $ echo "" >> b
   521   $ echo "" >> b
   522   $ echo "" >> b
   522   $ echo "" >> b
   523   $ hg annotate "primes.py" >> b
   523   $ hg annotate "primes.py" >> b
   527   $ echo "" >> b
   527   $ echo "" >> b
   528   $ cmp b a || diff -u b a
   528   $ cmp b a || diff -u b a
   529 
   529 
   530 hgweb filerevision, raw
   530 hgweb filerevision, raw
   531 
   531 
   532   $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/primes.py?style=raw') \
   532   $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py?style=raw') \
   533   >     > a
   533   >     > a
   534   $ echo "200 Script output follows" > b
   534   $ echo "200 Script output follows" > b
   535   $ echo "" >> b
   535   $ echo "" >> b
   536   $ hg cat primes.py >> b
   536   $ hg cat primes.py >> b
   537   $ cmp b a || diff -u b a
   537   $ cmp b a || diff -u b a
   538 
   538 
   539 hgweb highlightcss friendly
   539 hgweb highlightcss friendly
   540 
   540 
   541   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'highlightcss' > out
   541   $ get-with-headers.py localhost:$HGPORT 'highlightcss' > out
   542   $ head -n 4 out
   542   $ head -n 4 out
   543   200 Script output follows
   543   200 Script output follows
   544   
   544   
   545   /* pygments_style = friendly */
   545   /* pygments_style = friendly */
   546   
   546   
   547   $ rm out
   547   $ rm out
   548 
   548 
   549 errors encountered
   549 errors encountered
   550 
   550 
   551   $ cat errors.log
   551   $ cat errors.log
   552   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
   552   $ killdaemons.py $DAEMON_PIDS
   553 
   553 
   554 Change the pygments style
   554 Change the pygments style
   555 
   555 
   556   $ cat > .hg/hgrc <<EOF
   556   $ cat > .hg/hgrc <<EOF
   557   > [web]
   557   > [web]
   563   $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
   563   $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
   564   $ cat hg.pid >> $DAEMON_PIDS
   564   $ cat hg.pid >> $DAEMON_PIDS
   565 
   565 
   566 hgweb highlightcss fruity
   566 hgweb highlightcss fruity
   567 
   567 
   568   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'highlightcss' > out
   568   $ get-with-headers.py localhost:$HGPORT 'highlightcss' > out
   569   $ head -n 4 out
   569   $ head -n 4 out
   570   200 Script output follows
   570   200 Script output follows
   571   
   571   
   572   /* pygments_style = fruity */
   572   /* pygments_style = fruity */
   573   
   573   
   581   $ cd eucjp
   581   $ cd eucjp
   582   $ $PYTHON -c 'print("\265\376")' >> eucjp.txt  # Japanese kanji "Kyo"
   582   $ $PYTHON -c 'print("\265\376")' >> eucjp.txt  # Japanese kanji "Kyo"
   583   $ hg ci -Ama
   583   $ hg ci -Ama
   584   adding eucjp.txt
   584   adding eucjp.txt
   585   $ hgserveget () {
   585   $ hgserveget () {
   586   >     "$TESTDIR/killdaemons.py" $DAEMON_PIDS
   586   >     killdaemons.py $DAEMON_PIDS
   587   >     echo % HGENCODING="$1" hg serve
   587   >     echo % HGENCODING="$1" hg serve
   588   >     HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
   588   >     HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
   589   >     cat hg.pid >> $DAEMON_PIDS
   589   >     cat hg.pid >> $DAEMON_PIDS
   590   > 
   590   > 
   591   >     echo % hgweb filerevision, html
   591   >     echo % hgweb filerevision, html
   592   >     "$TESTDIR/get-with-headers.py" localhost:$HGPORT "file/tip/$2" \
   592   >     get-with-headers.py localhost:$HGPORT "file/tip/$2" \
   593   >         | grep '<div class="parity0 source">'
   593   >         | grep '<div class="parity0 source">'
   594   >     echo % errors encountered
   594   >     echo % errors encountered
   595   >     cat errors.log
   595   >     cat errors.log
   596   > }
   596   > }
   597   $ hgserveget euc-jp eucjp.txt
   597   $ hgserveget euc-jp eucjp.txt