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

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

Issue 2394683006: Switch analysis_server to use 'package:test'. (Closed)
Patch Set: Created 4 years, 2 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
Index: pkg/analysis_server/test/completion_test.dart
diff --git a/pkg/analysis_server/test/completion_test.dart b/pkg/analysis_server/test/completion_test.dart
index 778b1f0ce06cd40d3ced42469088a8c7c1baabe8..6896f291af4184a7543f5d61acc4c5724a48e64d 100644
--- a/pkg/analysis_server/test/completion_test.dart
+++ b/pkg/analysis_server/test/completion_test.dart
@@ -7,7 +7,7 @@ library test.completion.support;
import 'dart:async';
import 'dart:collection';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
import 'completion_test_support.dart';
import 'utils.dart';
@@ -19,17 +19,6 @@ main() {
}
/**
- * Assigning the name of a single test to this string causes just that test to
- * be run. Assigning null to this string causes all tests to be run.
- */
-const String SOLO_TEST = null;
-
-/**
- * Type of functions used to create tests.
- */
-typedef void _Tester(String spec, TestFunction body);
-
-/**
* A builder that builds the completion tests.
*/
class CompletionTestBuilder {
@@ -2848,7 +2837,8 @@ class A {
// test analysis of untyped fields and top-level vars
buildTests('test035', '''class Y {final x='hi';mth() {x.!1length;}}''',
- <String>["1+length"], failingTests: '1');
+ <String>["1+length"],
+ failingTests: '1');
// TODO(scheglov) decide what to do with Type for untyped field (not
// supported by the new store)
@@ -2977,10 +2967,9 @@ class A<Z extends X> {
}
for (LocationSpec spec in completionTests) {
String testName = '$baseName-${spec.id}';
- _Tester tester = testName == SOLO_TEST ? solo_test : test;
if (failingTests.contains(spec.id)) {
++expectedFailCount;
- tester("$testName (expected failure $expectedFailCount)", () {
+ test("$testName (expected failure $expectedFailCount)", () {
CompletionTestCase test = new CompletionTestCase();
return new Future(() => test.runTest(spec, extraFiles)).then((_) {
fail('Test passed - expected to fail.');
@@ -2988,7 +2977,7 @@ class A<Z extends X> {
});
} else {
++expectedPassCount;
- tester(testName, () {
+ test(testName, () {
CompletionTestCase test = new CompletionTestCase();
return test.runTest(spec, extraFiles);
});

Powered by Google App Engine
This is Rietveld 408576698