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

Unified Diff: pkg/analysis_server/test/stress/replay/replay.dart

Issue 2147223003: Fix a small bug in the stress test (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/stress/replay/replay.dart
diff --git a/pkg/analysis_server/test/stress/replay/replay.dart b/pkg/analysis_server/test/stress/replay/replay.dart
index 6c56047cfc0b868338440254ac246e92731bce8e..dd9016d7d60f97f54ffeb680bba0d773d000c485 100644
--- a/pkg/analysis_server/test/stress/replay/replay.dart
+++ b/pkg/analysis_server/test/stress/replay/replay.dart
@@ -9,6 +9,7 @@ library analysis_server.test.stress.replay.replay;
import 'dart:async';
import 'dart:io';
+import 'dart:math' as math;
import 'package:analysis_server/plugin/protocol/protocol.dart';
import 'package:analyzer/dart/ast/token.dart';
@@ -168,7 +169,8 @@ class Driver {
LineInfo info = fileEdit.lineInfo;
for (DiffHunk hunk in blobDiff.hunks) {
int srcStart = info.getOffsetOfLine(hunk.srcLine);
- int srcEnd = info.getOffsetOfLine(hunk.srcLine + hunk.removeLines.length);
+ int srcEnd = info.getOffsetOfLine(
+ math.min(hunk.srcLine + hunk.removeLines.length, info.lineCount - 1));
String addedText = _join(hunk.addLines);
//
// Create the source edits.
@@ -320,6 +322,7 @@ class Driver {
//
// Iterate over the history, applying changes.
//
+ int dotCount = 0;
bool firstCheckout = true;
ErrorMap expectedErrors = null;
Iterable<String> changedPubspecs;
@@ -363,6 +366,10 @@ class Driver {
}
changedPubspecs = commitDelta.filesMatching(PUBSPEC_FILE_NAME);
stdout.write('.');
+ if (dotCount++ > 100) {
+ stdout.writeln();
+ dotCount = 0;
+ }
}
server.removeAllOverlays();
stdout.writeln();
@@ -632,10 +639,8 @@ class Statistics {
if (hours > 0) {
return '$hours:$minutes:$seconds.$milliseconds';
} else if (minutes > 0) {
- return '$minutes:$seconds.$milliseconds m';
- } else if (seconds > 0) {
- return '$seconds.$milliseconds s';
+ return '$minutes:$seconds.$milliseconds';
}
- return '$milliseconds ms';
+ return '$seconds.$milliseconds';
}
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698