@@ -29,11 +29,6 @@ import 'package:io/io.dart';
29
29
import 'package:path/path.dart' as p;
30
30
import 'package:source_span/source_span.dart' ;
31
31
32
- // This isn't strictly required for anything, so if the import becomes invalid,
33
- // just comment it and related code out.
34
- import 'package:test_api/src/backend/invoker.dart' show Invoker;
35
- import 'package:uuid/uuid.dart' ;
36
-
37
32
import 'package_util.dart' ;
38
33
import 'util.dart' ;
39
34
@@ -193,13 +188,11 @@ class SharedAnalysisContext {
193
188
Future <FileContext > resolvedFileContextForTest (
194
189
String sourceText, {
195
190
String ? filename,
196
- bool includeTestDescription = true ,
197
191
bool preResolveLibrary = true ,
198
192
bool throwOnAnalysisErrors = true ,
199
193
IsExpectedError ? isExpectedError,
200
194
}) async {
201
- final fileContext =
202
- fileContextForTest (sourceText, filename: filename, includeTestDescription: includeTestDescription);
195
+ final fileContext = fileContextForTest (sourceText, filename: filename);
203
196
204
197
final context = collection.contexts.singleWhere ((c) => c.contextRoot.root.path == contextRootPath);
205
198
@@ -223,24 +216,8 @@ class SharedAnalysisContext {
223
216
return fileContext;
224
217
}
225
218
226
- FileContext fileContextForTest (
227
- String sourceText, {
228
- String ? filename,
229
- bool includeTestDescription = true ,
230
- }) {
219
+ FileContext fileContextForTest (String sourceText, {String ? filename}) {
231
220
filename ?? = nextFilename ();
232
-
233
- if (includeTestDescription) {
234
- // For convenience, include the current test description in the file as
235
- // a comment, so that:
236
- // - you can tell you're looking at the right file for a given test
237
- // - you can search for the test description to easily find the right file
238
- try {
239
- final testName = Invoker .current! .liveTest.test.name;
240
- sourceText = lineComment ('Created within test with name:\n > $testName ' ) + '\n ' + sourceText;
241
- } catch (_) {}
242
- }
243
-
244
221
final path = p.join (contextRootPath, _testFileSubpath, filename);
245
222
final file = File (path);
246
223
if (file.existsSync ()) {
0 commit comments