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

Unified Diff: pkg/analyzer/test/src/dart/analysis/base.dart

Issue 2522503004: Start implementing search support in AnalysisDriver. (Closed)
Patch Set: Created 4 years, 1 month 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 | « pkg/analyzer/lib/src/dart/analysis/search.dart ('k') | pkg/analyzer/test/src/dart/analysis/index_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/dart/analysis/base.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/base.dart b/pkg/analyzer/test/src/dart/analysis/base.dart
index a09836dd37554cdc528766dbd8f63785b5602108..ca912ec4144d92b1c46f3e5d57aeb0483d4030c4 100644
--- a/pkg/analyzer/test/src/dart/analysis/base.dart
+++ b/pkg/analyzer/test/src/dart/analysis/base.dart
@@ -13,6 +13,7 @@ import 'package:analyzer/src/dart/analysis/file_state.dart';
import 'package:analyzer/src/dart/analysis/status.dart';
import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl;
import 'package:analyzer/src/generated/source.dart';
+import 'package:test/test.dart';
import '../../context/mock_sdk.dart';
@@ -45,6 +46,33 @@ class BaseAnalysisDriverTest {
}
}
+ int findOffset(String search) {
+ int offset = testCode.indexOf(search);
+ expect(offset, isNonNegative, reason: "Not found '$search' in\n$testCode");
Brian Wilkerson 2016/11/21 21:17:11 nit: "Not found" --> "Did not find"
+ return offset;
+ }
+
+ int getLeadingIdentifierLength(String search) {
+ int length = 0;
+ while (length < search.length) {
+ int c = search.codeUnitAt(length);
+ if (c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0)) {
+ length++;
+ continue;
+ }
+ if (c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0)) {
+ length++;
+ continue;
+ }
+ if (c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0)) {
+ length++;
+ continue;
+ }
+ break;
+ }
+ return length;
+ }
+
void setUp() {
new MockSdk();
testProject = _p('/test/lib');
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/search.dart ('k') | pkg/analyzer/test/src/dart/analysis/index_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698