This is an archive of the discontinued LLVM Phabricator instance.

Fix opt-viewer tests failing after move from cgi.escape to html.escape
ClosedPublic

Authored by JamesNagurne on Apr 15 2020, 1:43 PM.

Details

Summary

These two tests utilize pre-generated opt-viewer output to diff against
a run of opt-viewer over a known yaml file.

In commit 4b428e8f (D76126), the escape function used for rendering was changed
from cgi.escape to html.escape. This modification causes a behavioral
difference with regards to quote characters.

cgi will not escape quotes by default, but html will.

Therefore, these tests were failing because they expected the old behavior
of "string", but was instead seeing "string&quot.

This solution modifies the known test outputs to use the escaped quotes
rather than not escaping quotes during rendering for no particular reason.

It is notable that when testing the optimization records generated by
LLVM, there was never quotes in the remarks I could find, specifically in
the Callee field where they exist in the pre-generated yaml for testing.

Diff Detail

Event Timeline

JamesNagurne created this revision.Apr 15 2020, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2020, 1:43 PM

LGTM, thanks for handling this.

This revision is now accepted and ready to land.Apr 15 2020, 11:13 PM

Unfortunately I don't have commit access.
Could one of you get this onto the upstream?

This revision was automatically updated to reflect the committed changes.