Chromium Code Reviews| Index: tools/testing/legpad/legpad.dart |
| diff --git a/tools/testing/legpad/legpad.dart b/tools/testing/legpad/legpad.dart |
| index b79b80ebfe96b71e3ce3e291eb42dd46e32b8a7b..474dc01e467cab65858d40729e172813880801c0 100644 |
| --- a/tools/testing/legpad/legpad.dart |
| +++ b/tools/testing/legpad/legpad.dart |
| @@ -80,10 +80,21 @@ class Legpad { |
| setText("output", output); |
| setText("warnings", warnings); |
| - String timing = "generated ${output.length} characters in " + |
| + int lineCount = lineCount(output); |
| + String timing = "generated $lineCount lines " + |
| + "(${output.length} characters) in " + |
| "${((elapsedMillis) / 1000).toStringAsPrecision(3)} seconds"; |
| setText("timing", timing); |
| } |
| + |
| + static int lineCount(String s) { |
|
ahe
2012/04/10 21:36:54
I feel this should be easier, but I don't know how
|
| + Iterable<Match> matches = "\n".allMatches(s); |
| + int n = 0; |
| + for (Match m in matches) { |
| + n++; |
| + } |
| + return n; |
| + } |
| void runLeg() { |
| uri_lib.Uri mainUri = new uri_lib.Uri.fromString(getText(MAIN_ID)); |