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

Unified Diff: tools/testing/dart/test_suite.dart

Issue 11358045: Update test utils to generate wrappers with new library syntax and handle (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « tools/testing/dart/browser_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
===================================================================
--- tools/testing/dart/test_suite.dart (revision 14431)
+++ tools/testing/dart/test_suite.dart (working copy)
@@ -977,12 +977,13 @@
RegExp leadingHashRegExp = const RegExp(r"^#", multiLine: true);
RegExp isolateStubsRegExp = const RegExp(r"// IsolateStubs=(.*)");
RegExp domImportRegExp =
- const RegExp(r"^#import.*(dart:(dom|html)|html\.dart).*\)",
- multiLine: true);
+ const RegExp(r"^[#]?import.*dart:html", multiLine: true);
RegExp libraryDefinitionRegExp =
- const RegExp(r"^#library\(", multiLine: true);
+ const RegExp(r"^[#]?library[\( ]", multiLine: true);
RegExp sourceOrImportRegExp =
- const RegExp(r"^#(source|import|resource)\(", multiLine: true);
+ const RegExp(r"^[#]?(source|part|import|resource)", multiLine: true);
Siggi Cherem (dart-lang) 2012/11/01 21:02:04 I think resource is gone. Also this matches more t
ahe 2012/11/01 21:08:42 I don't think it matters. There are good chances w
gram 2012/11/01 21:20:48 Yes, these false positives are very unlikely to ha
+ RegExp partofRegExp =
+ const RegExp(r"^[ \t]*part[ \t]*of[ \t]", multiLine: true);
// Read the entire file into a byte buffer and transform it to a
// String. This will treat the file as ascii but the only parts
@@ -1040,7 +1041,8 @@
String isolateStubs = isolateMatch != null ? isolateMatch[1] : '';
bool containsDomImport = domImportRegExp.hasMatch(contents);
bool isLibraryDefinition = libraryDefinitionRegExp.hasMatch(contents);
- bool containsSourceOrImport = sourceOrImportRegExp.hasMatch(contents);
+ bool containsSourceOrImport = sourceOrImportRegExp.hasMatch(contents) &&
+ !partofRegExp.hasMatch(contents);
Siggi Cherem (dart-lang) 2012/11/01 21:02:04 alternative you could include a ['"] in the match
int numStaticTypeAnnotations = 0;
for (var i in staticTypeRegExp.allMatches(contents)) {
numStaticTypeAnnotations++;
« no previous file with comments | « tools/testing/dart/browser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698