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

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

Issue 2913963002: Add negation to single-identifier tests in status files. (Closed)
Patch Set: Address comments Created 3 years, 7 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 | « tools/testing/dart/status_expression.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/status_file.dart
diff --git a/tools/testing/dart/status_file.dart b/tools/testing/dart/status_file.dart
index 8df6a70c575083fd4b7c175a49120f63af57cbfc..e29530693ff57d9f228fe976e7cab3181d9e1ea0 100644
--- a/tools/testing/dart/status_file.dart
+++ b/tools/testing/dart/status_file.dart
@@ -9,13 +9,10 @@ import 'expectation.dart';
import 'path.dart';
import 'status_expression.dart';
-/// Splits out a trailing line comment
-final _commentPattern = new RegExp("^([^#]*)(#.*)?\$");
-
/// Matches the header that begins a new section, like:
///
/// [ $compiler == dart2js && $minified ]
-final _sectionPattern = new RegExp(r"^\[([^\]]+)\]");
+final _sectionPattern = new RegExp(r"^\[(.+?)\]");
/// Matches an entry that defines the status for a path in the current section,
/// like:
@@ -27,7 +24,7 @@ final _entryPattern = new RegExp(r"\s*([^: ]*)\s*:(.*)");
///
/// blah_test: Fail # Issue 1234
/// ^^^^
-final _issuePattern = new RegExp("[Ii]ssue ([0-9]+)");
+final _issuePattern = new RegExp(r"[Ii]ssue (\d+)");
/// A parsed status file, which describes how a collection of tests are
/// expected to behave under various configurations and conditions.
@@ -72,19 +69,20 @@ class StatusFile {
}
// Strip off the comment and whitespace.
- var match = _commentPattern.firstMatch(line);
- var source = "";
+ var source = line;
var comment = "";
- if (match != null) {
- source = match[1].trim();
- comment = match[2] ?? "";
+ var hashIndex = line.indexOf('#');
+ if (hashIndex >= 0) {
+ source = line.substring(0, hashIndex);
+ comment = line.substring(hashIndex);
}
+ source = source.trim();
// Ignore empty (or comment-only) lines.
if (source.isEmpty) continue;
// See if we are starting a new section.
- match = _sectionPattern.firstMatch(source);
+ var match = _sectionPattern.firstMatch(source);
if (match != null) {
try {
var condition = Expression.parse(match[1].trim());
@@ -150,7 +148,7 @@ class StatusFile {
var match = _issuePattern.firstMatch(comment);
if (match == null) return null;
- return int.parse(match[1], onError: (_) => null);
+ return int.parse(match[1]);
}
String toString() {
« no previous file with comments | « tools/testing/dart/status_expression.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698