comparison tests/test-highlight.t @ 17017:953faba28e91

tests: prepare get-with-headers.py for MSYS get-with-headers.py took the http GET parameter as a command line parameter that had to start with '/'. MSYS on windows will mangle such paths. Instead of applying a workaround everywhere (such as an extra '/') we let get-with-headers.py add the mandatory '/'. That is consistent with the url path handling in the Mercurial url class. A few tests sent 'GET ?cmd=...' which is invalid. They will now send 'GET /?cmd=...'. This will not enable any tests for being run on windows - only remove one reason they were disabled.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 21 Jun 2012 03:05:02 +0200
parents f2719b387380
children 1ae119269ddc
comparison
equal deleted inserted replaced
17016:468a950aebc3 17017:953faba28e91
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 $ ("$TESTDIR/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">
181 </html> 181 </html>
182 182
183 183
184 hgweb fileannotate, html 184 hgweb fileannotate, html
185 185
186 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py') \ 186 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/primes.py') \
187 > | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g" 187 > | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g"
188 200 Script output follows 188 200 Script output follows
189 189
190 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 190 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
191 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> 191 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
507 </html> 507 </html>
508 508
509 509
510 hgweb fileannotate, raw 510 hgweb fileannotate, raw
511 511
512 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py?style=raw') \ 512 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/primes.py?style=raw') \
513 > | sed "s/test@//" > a 513 > | sed "s/test@//" > a
514 $ echo "200 Script output follows" > b 514 $ echo "200 Script output follows" > b
515 $ echo "" >> b 515 $ echo "" >> b
516 $ echo "" >> b 516 $ echo "" >> b
517 $ hg annotate "primes.py" >> b 517 $ hg annotate "primes.py" >> b
521 $ echo "" >> b 521 $ echo "" >> b
522 $ diff -u b a 522 $ diff -u b a
523 523
524 hgweb filerevision, raw 524 hgweb filerevision, raw
525 525
526 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py?style=raw') \ 526 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/primes.py?style=raw') \
527 > > a 527 > > a
528 $ echo "200 Script output follows" > b 528 $ echo "200 Script output follows" > b
529 $ echo "" >> b 529 $ echo "" >> b
530 $ hg cat primes.py >> b 530 $ hg cat primes.py >> b
531 $ diff -u b a 531 $ diff -u b a
532 532
533 hgweb highlightcss friendly 533 hgweb highlightcss friendly
534 534
535 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out 535 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'highlightcss' > out
536 $ head -n 4 out 536 $ head -n 4 out
537 200 Script output follows 537 200 Script output follows
538 538
539 /* pygments_style = friendly */ 539 /* pygments_style = friendly */
540 540
557 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log 557 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
558 $ cat hg.pid >> $DAEMON_PIDS 558 $ cat hg.pid >> $DAEMON_PIDS
559 559
560 hgweb highlightcss fruity 560 hgweb highlightcss fruity
561 561
562 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out 562 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'highlightcss' > out
563 $ head -n 4 out 563 $ head -n 4 out
564 200 Script output follows 564 200 Script output follows
565 565
566 /* pygments_style = fruity */ 566 /* pygments_style = fruity */
567 567
581 > echo % HGENCODING="$1" hg serve 581 > echo % HGENCODING="$1" hg serve
582 > HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log 582 > HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
583 > cat hg.pid >> $DAEMON_PIDS 583 > cat hg.pid >> $DAEMON_PIDS
584 > 584 >
585 > echo % hgweb filerevision, html 585 > echo % hgweb filerevision, html
586 > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/file/tip/$2" \ 586 > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "file/tip/$2" \
587 > | grep '<div class="parity0 source">' 587 > | grep '<div class="parity0 source">'
588 > echo % errors encountered 588 > echo % errors encountered
589 > cat errors.log 589 > cat errors.log
590 > } 590 > }
591 $ hgserveget euc-jp eucjp.txt 591 $ hgserveget euc-jp eucjp.txt