Skip to content

Commit f3c001b

Browse files
authored
Merge branch 'master' into dartdoc-0.28.0
2 parents eb202f9 + c8cf6ad commit f3c001b

File tree

8 files changed

+16
-247
lines changed

8 files changed

+16
-247
lines changed

lib/src/model.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6516,7 +6516,9 @@ class PackageBuilder {
65166516
}
65176517
}
65186518
var sourceKind = await driver.getSourceKind(filePath);
6519-
if (sourceKind == SourceKind.LIBRARY) {
6519+
// Allow dart source files with inappropriate suffixes (#1897). Those
6520+
// do not show up as SourceKind.LIBRARY.
6521+
if (sourceKind != SourceKind.PART) {
65206522
// Loading libraryElements from part files works, but is painfully slow
65216523
// and creates many duplicates.
65226524
return await driver.currentSession.getResolvedLibrary(source.fullName);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dev_dependencies:
3232
build: ^1.0.1
3333
build_runner: ^1.0.0
3434
build_version: ^1.0.0
35-
coverage: any
35+
coverage: ^0.12.4
3636
dhttpd: ^3.0.0
3737
glob: ^1.1.5
3838
grinder: ^0.8.2

test/dartdoc_test.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,6 @@ void main() {
178178
throwsA(const TypeMatcher<ProcessException>()));
179179
});
180180

181-
test('errors cause non-zero exit when warnings are on', () async {
182-
expect(
183-
() => subprocessLauncher.runStreamed(Platform.resolvedExecutable, [
184-
dartdocPath,
185-
'--input=${testPackageToolError.path}',
186-
'--output=${pathLib.join(tempDir.absolute.path, 'test_package_tool_error')}',
187-
'--show-warnings',
188-
]),
189-
throwsA(const TypeMatcher<ProcessException>()));
190-
});
191-
192181
test('help prints command line args', () async {
193182
List<String> outputLines = [];
194183
await subprocessLauncher.runStreamed(

test/model_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,10 @@ void main() {
675675
expect(anonLib.isDeprecated, isFalse);
676676
});
677677

678+
test('can be reexported even if the file suffix is not .dart', () {
679+
expect(fakeLibrary.allClasses.map((c) => c.name), contains('MyClassFromADartFile'));
680+
});
681+
678682
test('that is deprecated has a deprecated css class in linkedName', () {
679683
expect(isDeprecated.linkedName, contains('class="deprecated"'));
680684
});

test/src/utils.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ class CoverageSubprocessLauncher extends SubprocessLauncher {
155155
/// Wait for all coverage runs to finish.
156156
await Future.wait(currentCoverageResults);
157157

158-
return launcher.runStreamed(Platform.executable, [
159-
'tool/format_coverage.dart', // TODO(jcollins-g): use pub after dart-lang/coverage#240 is landed
158+
return launcher.runStreamed('pub', [
159+
'run',
160+
'coverage:format_coverage',
160161
'--lcov',
161162
'-v',
162163
'-b', '.',

testing/test_package/lib/fake.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import 'example.dart';
5858
import 'mylibpub.dart' as renamedLib;
5959
import 'mylibpub.dart' as renamedLib2;
6060
import 'two_exports.dart' show BaseClass;
61+
export 'src/notadotdartfile';
6162

6263
// ignore: uri_does_not_exist
6364
export 'package:test_package_imported/categoryExporting.dart'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/// Test importing with an invalid dart file extension. (#1897)
2+
library test_package.notadotdartfile;
3+
4+
class MyClassFromADartFile {}

tool/format_coverage.dart

Lines changed: 0 additions & 232 deletions
This file was deleted.

0 commit comments

Comments
 (0)