From 6025d9881c00a0d4b538f06ce157eed416045e10 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Jan 2019 11:43:56 +0000 Subject: hval: add src_escape for highlight post-processing We need to post-process "highlight" output to ensure it doesn't contain odd bytes which cause "wide character" warnings or require odd glyphs in source form. --- t/hval.t | 3 +++ 1 file changed, 3 insertions(+) (limited to 't') diff --git a/t/hval.t b/t/hval.t index a193c296..bfc9a856 100644 --- a/t/hval.t +++ b/t/hval.t @@ -43,5 +43,8 @@ is('foo-bar', PublicInbox::Hval::to_filename("foo bar\nanother line\n"), is('foo.bar', PublicInbox::Hval::to_filename("foo....bar"), 'to_filename squeezes -'); +my $s = "\0\x07\n"; +PublicInbox::Hval::src_escape($s); +is($s, "\\0\\a\n", 'src_escape works as intended'); done_testing(); -- cgit v1.2.3-24-ge0c7