Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1312)

Issue 9022042: Hacking format of Expect failure messages to play nice with rendered HTML. (Closed)

Created:
8 years, 12 months ago by pquitslund
Modified:
8 years, 11 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Hacking format of Expect failure messages to play nice with rendered HTML. The culprits are the '<' and '>' in this bit: _fail("Expect.equals(expected: <$expected>, actual: <$actual>$msg) fails.") in Expect.equals(..) which cause $expected and $actual to get treated as tags when the message is shoveled (untreated) into an HTML page as one might do when rendering test run results in an HTML page (e.g., http://codereview.chromium.org/9034030/). This here *hack* sidesteps the issue but it's neither elegant nor properly placed (methinks). The question is, how should this problem get fixed for real? Thoughts/redirects greatly appreciated! Committed: https://code.google.com/p/dart/source/detail?r=2954

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 2

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -2 lines) Patch
M client/testing/unittest/unittest.dart View 1 2 3 4 1 chunk +9 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
pquitslund
8 years, 12 months ago (2011-12-30 00:22:31 UTC) #1
Siggi Cherem (dart-lang)
lgtm This seems reasonable to me. I'd add a TODO to move the escaping code ...
8 years, 11 months ago (2012-01-04 16:28:36 UTC) #2
pquitslund
8 years, 11 months ago (2012-01-04 18:05:50 UTC) #3
On 2012/01/04 16:28:36, sigmund wrote:
> lgtm
> 
> This seems reasonable to me.

Cool.  Thanks.

> 
> I'd add a TODO to move the escaping code to some common library (see that it
is
> already defined in utils/dartdoc/markdown.dart, samples/markdown/lib.dart, and
> utils/tip/tip.dart.)

Done.

> 
> Or add a common library, which I'm not sure where it should go.

A good idea I think but since I'm only just starting to feel my way around I'm
not ready to propose a home either...

> 
>
http://codereview.chromium.org/9022042/diff/5001/client/testing/unittest/unit...
> File client/testing/unittest/unittest.dart (right):
> 
>
http://codereview.chromium.org/9022042/diff/5001/client/testing/unittest/unit...
> client/testing/unittest/unittest.dart:106: String _sanitize(String string) {
> _sanitize -> _htmlEscape ?

Done.

> 
>
http://codereview.chromium.org/9022042/diff/5001/client/testing/unittest/unit...
> client/testing/unittest/unittest.dart:107: return
> string.replaceAll('<','&lt;').replaceAll('>','&gt;');
> add also '&amp;'

Right!  Fixed.

Thanks!

Powered by Google App Engine
This is Rietveld 408576698