@@ -50,18 +50,17 @@ class ExpectedDiagnostic {
5050 /// The offset of the beginning of the diagnostic's region.
5151 final int _offset;
5252
53- /// The offset of the beginning of the diagnostic's region.
53+ /// The length of the diagnostic's region.
5454 final int _length;
5555
5656 /// A pattern that should be contained in the diagnostic message or `null` if
5757 /// the message contents should not be checked.
5858 final Pattern ? _messageContains;
5959
60- // A pattern that should be contained in the error's correction message, or
61- // `null` if the correction message contents should not be checked.
60+ /// A pattern that should be contained in the error's correction message, or
61+ /// `null` if the correction message contents should not be checked.
6262 final Pattern ? _correctionContains;
6363
64- /// Initialize a newly created diagnostic description.
6564 ExpectedDiagnostic (
6665 this ._diagnosticMatcher,
6766 this ._offset,
@@ -96,6 +95,7 @@ mixin LanguageVersion219Mixin on PubPackageResolutionTest {
9695}
9796
9897abstract class LintRuleTest extends PubPackageResolutionTest {
98+ /// The name of the lint rule which this test is concerned with.
9999 String get lintRule;
100100
101101 @override
@@ -107,6 +107,12 @@ abstract class LintRuleTest extends PubPackageResolutionTest {
107107 return [ruleName];
108108 }
109109
110+ /// Returns an "expected diagnostic" for [lintRule] (or [name] , if given) at
111+ /// [offset] and [length] .
112+ ///
113+ /// If given, [messageContains] is used to match against a diagnostic's
114+ /// message, and [correctionContains] is used to match against a diagnostic's
115+ /// correction message.
110116 ExpectedDiagnostic lint (
111117 int offset,
112118 int length, {
@@ -125,27 +131,52 @@ abstract class LintRuleTest extends PubPackageResolutionTest {
125131class PubPackageResolutionTest extends _ContextResolutionTest {
126132 final List <String > _lintRules = const [];
127133
134+ /// Adds the 'fixnum' package as a dependency to the package-under-test.
135+ ///
136+ /// This allows `package:fixnum/fixnum.dart` imports to resolve.
128137 bool get addFixnumPackageDep => false ;
129138
139+ /// Adds the 'flutter' package as a dependency to the package-under-test.
140+ ///
141+ /// This allows various `package:flutter/` imports to resolve.
130142 bool get addFlutterPackageDep => false ;
131143
144+ /// Adds the 'js' package as a dependency to the package-under-test.
145+ ///
146+ /// This allows various `package:js/` imports to resolve.
132147 bool get addJsPackageDep => false ;
133148
149+ /// Adds the 'kernel' package as a dependency to the package-under-test.
150+ ///
151+ /// This allows various `package:kernel/` imports to resolve.
134152 bool get addKernelPackageDep => false ;
135153
154+ /// Adds the 'meta' package as a dependency to the package-under-test.
155+ ///
156+ /// This allows various `package:meta/` imports to resolve.
136157 bool get addMetaPackageDep => false ;
137158
159+ /// Adds the 'test_reflective_loader' package as a dependency to the
160+ /// package-under-test.
161+ ///
162+ /// This allows various `package:test_reflective_loader/` imports to resolve.
138163 bool get addTestReflectiveLoaderPackageDep => false ;
139164
165+ /// Whether to print out the syntax tree being tested, on a test failure.
140166 bool get dumpAstOnFailures => true ;
141167
168+ /// The list of language experiments to be enabled for these tests.
142169 List <String > get experiments => experimentsForTests;
143170
144171 String get testFileName => 'test.dart' ;
145172
146173 @override
147174 String get testFilePath => '$testPackageLibPath /$testFileName ' ;
148175
176+ /// The language version for the package-under-test.
177+ ///
178+ /// Used for writing out a package config file. A `null` value means no
179+ /// 'languageVersion' is written to the package config file.
149180 String ? get testPackageLanguageVersion => null ;
150181
151182 String get testPackageLibPath => '$testPackageRootPath /lib' ;
0 commit comments