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

Side by Side Diff: tools/migration/lib/src/validate.dart

Issue 2991803003: Report more heuristics for tests that require manual work. (Closed)
Patch Set: Tweaks. Created 3 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 unified diff | Download patch
« no previous file with comments | « tools/migration/lib/src/log.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'log.dart';
6
7 final _unittestPattern = "package:unittest";
8 final _checkedPattern = new RegExp(r"\bchecked\b");
9 final _abstractErrorPattern =
10 new RegExp(r"\bAbstractClassInstantiationError\b");
11 final _typeErrorPattern = new RegExp(r"\bTypeError\b");
12
13 void validateFile(String path, String source, [List<String> todos]) {
14 check(Pattern pattern, String noteMessage, String todo) {
15 if (!source.contains(pattern)) return;
16 note("${bold(path)} $noteMessage.");
17 if (todos != null) todos.add(todo);
18 }
19
20 check(_unittestPattern, "uses the unittest package", "Migrate off unittest.");
21 check(_checkedPattern, 'mentions "checked"',
22 'Fix code that mentions "checked" mode.');
23 check(_abstractErrorPattern, 'mentions "AbstractClassInstantiationError"',
24 "Remove code that checks for AbstractClassInstantiationError.");
25 check(_typeErrorPattern, 'mentions "TypeError"',
26 "Ensure code that checks for a TypeError uses 2.0 semantics.");
27 }
OLDNEW
« no previous file with comments | « tools/migration/lib/src/log.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698