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

Unified Diff: pkg/analysis_server/test/completion_test_support.dart

Issue 806413003: Print a count of total tests and expected failures in completion tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/analysis_server/test/completion_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/completion_test_support.dart
diff --git a/pkg/analysis_server/test/completion_test_support.dart b/pkg/analysis_server/test/completion_test_support.dart
index 3d4157a040f820f88a518f3bb32ea627664e1c5c..d9fb3c6a23a416052b7be6d3805e940f8bf9646d 100644
--- a/pkg/analysis_server/test/completion_test_support.dart
+++ b/pkg/analysis_server/test/completion_test_support.dart
@@ -96,68 +96,6 @@ class CompletionTestCase extends CompletionTest {
super.tearDown();
});
}
-
- /**
- * Generate a set of completion tests based on the given [originalSource].
- *
- * The source string has completion points embedded in it, which are
- * identified by '!X' where X is a single character. Each X is matched to
- * positive or negative results in the array of [validationStrings].
- * Validation strings contain the name of a prediction with a two character
- * prefix. The first character of the prefix corresponds to an X in the
- * [originalSource]. The second character is either a '+' or a '-' indicating
- * whether the string is a positive or negative result.
- *
- * The [originalSource] is the source for a completion test that contains
- * completion points. The [validationStrings] are the positive and negative
- * predictions.
- *
- * Optional argument [failingTests], if given, is a string, each character of
- * which corresponds to an X in the [originalSource] for which the test is
- * expected to fail. This sould be used to mark known completion bugs that
- * have not yet been fixed.
- */
- static void buildTests(String baseName, String originalSource,
- List<String> results, {Map<String, String> extraFiles, String failingTests:
- ''}) {
- List<LocationSpec> completionTests =
- LocationSpec.from(originalSource, results);
- completionTests.sort((LocationSpec first, LocationSpec second) {
- return first.id.compareTo(second.id);
- });
- if (completionTests.isEmpty) {
- test(baseName, () {
- fail(
- "Expected exclamation point ('!') within the source denoting the"
- "position at which code completion should occur");
- });
- }
- Set<String> allSpecIds =
- completionTests.map((LocationSpec spec) => spec.id).toSet();
- for (String id in failingTests.split('')) {
- if (!allSpecIds.contains(id)) {
- test("$baseName-$id", () {
- fail(
- "Test case '$id' included in failingTests, but this id does not exist.");
- });
- }
- }
- for (LocationSpec spec in completionTests) {
- if (failingTests.contains(spec.id)) {
- test("$baseName-${spec.id} (expected failure)", () {
- CompletionTestCase test = new CompletionTestCase();
- return new Future(() => test.runTest(spec, extraFiles)).then((_) {
- fail('Test passed - expected to fail.');
- }, onError: (_) {});
- });
- } else {
- test("$baseName-${spec.id}", () {
- CompletionTestCase test = new CompletionTestCase();
- return test.runTest(spec, extraFiles);
- });
- }
- }
- }
}
/**
« no previous file with comments | « pkg/analysis_server/test/completion_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698