tests/test-wsgicgi.t
author Raphaël Gomès <rgomes@octobus.net>
Mon, 29 Jul 2024 10:06:28 +0200
changeset 51735 76c44ae8862e
parent 50937 04bfcb416745
child 51983 46afce95e5a5
permissions -rw-r--r--
rustfmt: apply formatting expected by newer nightly version This was missed in 3876d4c6c79ec5c71e8c51b876cc157e93a5eaac somehow.

  $ hg init test
  $ cat >hgweb.cgi <<HGWEB
  > #!$PYTHON
  > from mercurial import demandimport; demandimport.enable()
  > from mercurial.hgweb import hgweb
  > from mercurial.hgweb import wsgicgi
  > application = hgweb(b"test", b"Empty test repository")
  > wsgicgi.launch(application)
  > HGWEB
  $ chmod 755 hgweb.cgi

Check that non-ASCII bytes roundtrip correctly.

  $ . "$TESTDIR/cgienv"
  $ PATH_INFO="/rev/$(python -c 'import sys; sys.stdout.buffer.write(b"\xe2\x80\x94")')"; export PATH_INFO
  $ QUERY_STRING="style=raw"; export QUERY_STRING
  $ "$PYTHON" ./hgweb.cgi | grep error
  error: unknown revision '\xe2\x80\x94' (esc)