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

Unified Diff: pkg/analysis_testing/lib/abstract_single_unit.dart

Issue 498763003: Initial 'Extract Method' refactoring implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
Index: pkg/analysis_testing/lib/abstract_single_unit.dart
diff --git a/pkg/analysis_testing/lib/abstract_single_unit.dart b/pkg/analysis_testing/lib/abstract_single_unit.dart
index 7930d09172bc8f57502712c7292e00510638c280..15e70d6a1fe17542228fd8ea202e7eb8916a5170 100644
--- a/pkg/analysis_testing/lib/abstract_single_unit.dart
+++ b/pkg/analysis_testing/lib/abstract_single_unit.dart
@@ -61,6 +61,10 @@ class AbstractSingleUnitTest extends AbstractContextTest {
return ElementLocator.locate(node);
}
+ int findEnd(String search) {
+ return findOffset(search) + search.length;
+ }
+
int findOffset(String search) {
int offset = testCode.indexOf(search);
expect(offset, isNonNegative, reason: "Not found '$search' in\n$testCode");

Powered by Google App Engine
This is Rietveld 408576698