Mercurial > public > mercurial-scm > hg-stable
diff tests/test-hgweb-json.t @ 35169:d2eff9d4db3f
tests: move JSON escape test to test-hgweb-json.t
The original tests (kanji and null) in test-hgweb-commands.t come from
aff419e260f9 and 823a7d79ef82, but they check json escape filter by using
JavaScript variable on /graph page, which is awkward, and I'm planning to
remove commit description from this variable soon. Let's move the parts that
check json template filter to a more appropriate file and use normal json-*
templates.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 30 Nov 2017 16:30:43 +0800 |
parents | b0262b25ab48 |
children | b963750b125f |
line wrap: on
line diff
--- a/tests/test-hgweb-json.t Wed Nov 29 07:57:17 2017 +0530 +++ b/tests/test-hgweb-json.t Thu Nov 30 16:30:43 2017 +0800 @@ -1648,3 +1648,28 @@ "rawdoc": "Working with Phases\n*", (glob) "topic": "phases" } + +Commit message with Japanese Kanji 'Noh', which ends with '\x5c' + + $ echo foo >> da/foo + $ HGENCODING=cp932 hg ci -m `$PYTHON -c 'print("\x94\x5c")'` + +Commit message with null character + + $ echo foo >> da/foo + >>> open('msg', 'wb').write('commit with null character: \0\n') + $ hg ci -l msg + $ rm msg + +Stop and restart with HGENCODING=cp932 + + $ killdaemons.py + $ HGENCODING=cp932 hg serve -p $HGPORT -d --pid-file=hg.pid \ + > -A access.log -E error.log + $ cat hg.pid >> $DAEMON_PIDS + +Test json escape of multibyte characters + + $ request json-filelog/tip/da/foo?revcount=2 | grep '"desc":' + "desc": "commit with null character: \u0000", + "desc": "\u80fd",