Skip to content

Commit 2fa7811

Browse files
authored
Refactor extension type template tests to use test_reflective_loader (#3676)
1 parent 43c2663 commit 2fa7811

File tree

3 files changed

+394
-311
lines changed

3 files changed

+394
-311
lines changed

lib/src/model_utils.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ import 'package:analyzer/file_system/file_system.dart';
99
import 'package:dartdoc/src/failure.dart';
1010
import 'package:dartdoc/src/model/model.dart';
1111
import 'package:glob/glob.dart';
12+
import 'package:meta/meta.dart';
1213
import 'package:path/path.dart' as path;
1314

1415
final _driveLetterMatcher = RegExp(r'^\w:\\');
1516

1617
final Map<String, String> _fileContents = <String, String>{};
1718

19+
@visibleForTesting
20+
void clearFileContentsCache() => _fileContents.clear();
21+
1822
/// This will handle matching globs, including on Windows.
1923
///
2024
/// On windows, globs are assumed to use absolute Windows paths with drive

test/src/test_descriptor_utils.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'dart:convert';
66

77
import 'package:analyzer/file_system/memory_file_system.dart';
8+
import 'package:dartdoc/src/model_utils.dart';
89
import 'package:test_descriptor/test_descriptor.dart' as d;
910
import 'package:yaml/yaml.dart' as yaml;
1011

@@ -84,6 +85,7 @@ Future<String> createPackage(
8485
],
8586
),
8687
]);
88+
clearFileContentsCache();
8789
if (resourceProvider == null) {
8890
await packageDir.create();
8991
return packageDir.io.path;

0 commit comments

Comments
 (0)