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

Unified Diff: pkg/analysis_server/test/integration/analysis/occurrences_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/integration/analysis/occurrences_test.dart
diff --git a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
index 1bcb2709bcf687baaad33652af9ccec347a9c842..7dbb360822730304808e7409624b2ae97c6f1825 100644
--- a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
@@ -5,15 +5,17 @@
library test.integration.analysis.occurrences;
import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
import '../../utils.dart';
import '../integration_tests.dart';
main() {
initializeTestEnvironment();
- defineReflectiveTests(Test);
+ defineReflectiveSuite(() {
+ defineReflectiveTests(Test);
+ });
}
@reflectiveTest
@@ -52,6 +54,7 @@ main() {
fail('No element found matching $elementName');
return null;
}
+
void check(String elementName, Iterable<String> expectedOccurrences) {
Set<int> expectedOffsets = expectedOccurrences
.map((String substring) => text.indexOf(substring))
@@ -59,6 +62,7 @@ main() {
Set<int> foundOffsets = findOffsets(elementName);
expect(foundOffsets, equals(expectedOffsets));
}
+
check('i', ['i = 0', 'i < 10', 'i++', 'i;']);
check('j', ['j = 0', 'j < i', 'j++', 'j;']);
check('sum', ['sum = 0', 'sum +=', 'sum)']);

Powered by Google App Engine
This is Rietveld 408576698