Skip to content

Commit 1997e7d

Browse files
committed
Merge branch 'master' of github.com:dart-lang/dartdoc into sl-undo-workaround
2 parents 044451d + ce9b4cd commit 1997e7d

File tree

3 files changed

+96
-58
lines changed

3 files changed

+96
-58
lines changed

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ packages:
8888
markdown:
8989
description: markdown
9090
source: hosted
91-
version: "0.7.1+3"
91+
version: "0.7.2"
9292
matcher:
9393
description: matcher
9494
source: hosted

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
html: ^0.12.1
1414
http: ^0.11.0
1515
logging: '>=0.9.0 <0.12.0'
16-
markdown: ^0.7.1
16+
markdown: ^0.7.2
1717
mustache4dart: ^1.0.9
1818
path: ^1.3.0
1919
pub_cache: ^0.1.0

test/model_test.dart

Lines changed: 94 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ void main() {
3434
exit(1);
3535
}
3636

37-
Package sdkAsPackage = new Package(getSdkLibrariesToDocument(
37+
Package sdkAsPackage = new Package(
38+
getSdkLibrariesToDocument(
3839
testUtils.sdkDir, testUtils.analyzerHelper.context),
3940
new PackageMeta.fromSdk(sdkDir));
4041

@@ -93,7 +94,8 @@ void main() {
9394
Library dartAsyncLib;
9495

9596
setUp(() {
96-
dartAsyncLib = new Library(getSdkLibrariesToDocument(
97+
dartAsyncLib = new Library(
98+
getSdkLibrariesToDocument(
9799
testUtils.sdkDir, testUtils.analyzerHelper.context).first,
98100
sdkAsPackage);
99101

@@ -224,33 +226,33 @@ void main() {
224226
});
225227

226228
test('links to a reference to its class', () {
227-
expect(docsAsHtml, contains(
228-
'<a href="fake/BaseForDocComments-class.html">BaseForDocComments</a>'));
229+
expect(
230+
docsAsHtml,
231+
contains(
232+
'<a href="fake/BaseForDocComments-class.html">BaseForDocComments</a>'));
229233
});
230234

231235
test(
232236
'links to a reference to a top-level const with multiple underscores',
233237
() {
234238
expect(
235-
docsAsHtml, contains('<a href="">NAME_WITH_TWO_UNDERSCORES</a>'));
236-
}, skip: 'Wait for https://github.com/dart-lang/dartdoc/issues/768');
237-
238-
// remove this test when the above is fixed. just here to track when
239-
// the behavior changes
240-
test(
241-
'literally renders a reference to a top-level const with multiple underscores',
242-
() {
243-
expect(docsAsHtml, contains('[NAME_WITH_TWO_UNDERSCORES]'));
239+
docsAsHtml,
240+
contains(
241+
'<a href="fake/NAME_WITH_TWO_UNDERSCORES.html">NAME_WITH_TWO_UNDERSCORES</a>'));
244242
});
245243

246244
test('links to a method in this class', () {
247-
expect(docsAsHtml, contains(
248-
'<a href="fake/BaseForDocComments/anotherMethod.html">anotherMethod</a>'));
245+
expect(
246+
docsAsHtml,
247+
contains(
248+
'<a href="fake/BaseForDocComments/anotherMethod.html">anotherMethod</a>'));
249249
});
250250

251251
test('links to a top-level function in this library', () {
252-
expect(docsAsHtml, contains(
253-
'<a href="fake/topLevelFunction.html">topLevelFunction</a>'));
252+
expect(
253+
docsAsHtml,
254+
contains(
255+
'<a href="fake/topLevelFunction.html">topLevelFunction</a>'));
254256
});
255257

256258
test('links to top-level function from an imported library', () {
@@ -263,34 +265,44 @@ void main() {
263265
});
264266

265267
test('links to a top-level const from an imported lib', () {
266-
expect(docsAsHtml, contains(
267-
'<a href="fake/incorrectDocReference.html">incorrectDocReference</a>'));
268+
expect(
269+
docsAsHtml,
270+
contains(
271+
'<a href="fake/incorrectDocReference.html">incorrectDocReference</a>'));
268272
});
269273

270274
test('links to a top-level variable with a prefix from an imported lib',
271275
() {
272276
expect(docsAsHtml,
273277
contains('<a href="">css.theOnlyThingInTheLibrary</a>'));
274-
}, skip: 'Wait for https://github.com/dart-lang/dartdoc/issues/767 to be fixed');
278+
},
279+
skip:
280+
'Wait for https://github.com/dart-lang/dartdoc/issues/767 to be fixed');
275281

276282
// remove this test when the above test is fixed. just here to
277283
// track when the behavior changes
278284
test('codeifies a prefixed top-level variable an imported lib', () {
279-
expect(docsAsHtml, contains(
280-
'<code class="prettyprint lang-dart">css.theOnlyThingInTheLibrary</code>'));
285+
expect(
286+
docsAsHtml,
287+
contains(
288+
'<code class="prettyprint lang-dart">css.theOnlyThingInTheLibrary</code>'));
281289
});
282290

283291
test('links to a name with a single underscore', () {
284-
expect(docsAsHtml, contains(
285-
'<a href="fake/NAME_SINGLEUNDERSCORE.html">NAME_SINGLEUNDERSCORE</a>'));
292+
expect(
293+
docsAsHtml,
294+
contains(
295+
'<a href="fake/NAME_SINGLEUNDERSCORE.html">NAME_SINGLEUNDERSCORE</a>'));
286296
});
287297
});
288298

289299
test('multi-underscore names in brackets do not become italicized', () {
290300
expect(short.documentation, contains('[NAME_WITH_TWO_UNDERSCORES]'));
291-
expect(short.documentationAsHtml, contains(
292-
'<a href="fake/NAME_WITH_TWO_UNDERSCORES.html">NAME_WITH_TWO_UNDERSCORES</a>'));
293-
}, skip: 'Wait for https://github.com/dart-lang/dartdoc/issues/768');
301+
expect(
302+
short.documentationAsHtml,
303+
contains(
304+
'<a href="fake/NAME_WITH_TWO_UNDERSCORES.html">NAME_WITH_TWO_UNDERSCORES</a>'));
305+
});
294306

295307
test('still has brackets inside code blocks', () {
296308
expect(topLevelFunction.documentationAsHtml,
@@ -301,17 +313,21 @@ void main() {
301313
() {
302314
Method add =
303315
specialList.allInstanceMethods.firstWhere((m) => m.name == 'add');
304-
expect(add.oneLineDoc, equals(
305-
'Adds <code class="prettyprint lang-dart">value</code> to the end of this list,\nextending the length by one.'));
316+
expect(
317+
add.oneLineDoc,
318+
equals(
319+
'Adds <code class="prettyprint lang-dart">value</code> to the end of this list,\nextending the length by one.'));
306320
});
307321

308322
test(
309323
'full documentation references from inherited methods should not have brackets',
310324
() {
311325
Method add =
312326
specialList.allInstanceMethods.firstWhere((m) => m.name == 'add');
313-
expect(add.documentationAsHtml, startsWith(
314-
'<p>Adds <code class="prettyprint lang-dart">value</code> to the end of this list,\nextending the length by one.'));
327+
expect(
328+
add.documentationAsHtml,
329+
startsWith(
330+
'<p>Adds <code class="prettyprint lang-dart">value</code> to the end of this list,\nextending the length by one.'));
315331
});
316332

317333
test('incorrect doc references are still wrapped in code blocks', () {
@@ -330,8 +346,10 @@ void main() {
330346
});
331347

332348
test('doc ref to class in SDK does not render as link', () {
333-
expect(thisIsAsync.documentationAsHtml, equals(
334-
'<p>An async function. It should look like I return a <code class="prettyprint lang-dart">Future</code>.</p>'));
349+
expect(
350+
thisIsAsync.documentationAsHtml,
351+
equals(
352+
'<p>An async function. It should look like I return a <code class="prettyprint lang-dart">Future</code>.</p>'));
335353
});
336354

337355
test('references are correct in exported libraries', () {
@@ -341,8 +359,10 @@ void main() {
341359
expect(resolved, isNotNull);
342360
expect(resolved,
343361
contains('<a href="two_exports/BaseClass-class.html">BaseClass</a>'));
344-
expect(resolved, contains(
345-
'linking over to <code class="prettyprint lang-dart">Apple</code>.'));
362+
expect(
363+
resolved,
364+
contains(
365+
'linking over to <code class="prettyprint lang-dart">Apple</code>.'));
346366
});
347367

348368
test('references to class and constructors', () {
@@ -351,8 +371,10 @@ void main() {
351371
contains('Extends class <a href="ex/Apple-class.html">Apple</a>'));
352372
expect(
353373
comment, contains('use <a href="ex/Apple/Apple.html">new Apple</a>'));
354-
expect(comment, contains(
355-
'<a href="ex/Apple/Apple.fromString.html">new Apple.fromString</a>'));
374+
expect(
375+
comment,
376+
contains(
377+
'<a href="ex/Apple/Apple.fromString.html">new Apple.fromString</a>'));
356378
});
357379

358380
test('reference to class from another library', () {
@@ -362,13 +384,17 @@ void main() {
362384

363385
test('reference to method', () {
364386
String comment = foo2.documentationAsHtml;
365-
expect(comment, equals(
366-
'<p>link to method from class <a href="ex/Apple/m.html">Apple.m</a></p>'));
387+
expect(
388+
comment,
389+
equals(
390+
'<p>link to method from class <a href="ex/Apple/m.html">Apple.m</a></p>'));
367391
});
368392

369393
test('legacy code blocks render correctly', () {
370-
expect(testingCodeSyntaxInOneLiners.oneLineDoc, equals(
371-
'These are code syntaxes: <code class="prettyprint lang-dart">true</code> and <code class="prettyprint lang-dart">false</code>'));
394+
expect(
395+
testingCodeSyntaxInOneLiners.oneLineDoc,
396+
equals(
397+
'These are code syntaxes: <code class="prettyprint lang-dart">true</code> and <code class="prettyprint lang-dart">false</code>'));
372398
});
373399

374400
test('doc comments to parameters are marked as code', () {
@@ -493,8 +519,8 @@ void main() {
493519

494520
test('exported class should have linkedReturnType for the current library',
495521
() {
496-
Method toUTC = DT.instanceMethods.firstWhere((m) => m.name == 'toUtc',
497-
orElse: () => null);
522+
Method toUTC = DT.instanceMethods
523+
.firstWhere((m) => m.name == 'toUtc', orElse: () => null);
498524
expect(toUTC, isNotNull);
499525
expect(toUTC.linkedReturnType,
500526
equals('<a href="ex/DateTime-class.html">DateTime</a>'));
@@ -626,19 +652,25 @@ void main() {
626652
test('async function', () {
627653
expect(thisIsAsync.isAsynchronous, isTrue);
628654
expect(thisIsAsync.linkedReturnType, equals('Future'));
629-
expect(thisIsAsync.documentation, equals(
630-
'An async function. It should look like I return a [Future].'));
631-
expect(thisIsAsync.documentationAsHtml, equals(
632-
'<p>An async function. It should look like I return a <code class="prettyprint lang-dart">Future</code>.</p>'));
655+
expect(
656+
thisIsAsync.documentation,
657+
equals(
658+
'An async function. It should look like I return a [Future].'));
659+
expect(
660+
thisIsAsync.documentationAsHtml,
661+
equals(
662+
'<p>An async function. It should look like I return a <code class="prettyprint lang-dart">Future</code>.</p>'));
633663
});
634664

635665
test('docs do not lose brackets in code blocks', () {
636666
expect(topLevelFunction.documentation, contains("['hello from dart']"));
637667
});
638668

639669
test('has source code', () {
640-
expect(topLevelFunction.sourceCode, startsWith(
641-
'/// Top-level function 3 params and 1 optional positional param.'));
670+
expect(
671+
topLevelFunction.sourceCode,
672+
startsWith(
673+
'/// Top-level function 3 params and 1 optional positional param.'));
642674
expect(topLevelFunction.sourceCode, endsWith('''
643675
String topLevelFunction(int param1, bool param2, Cool coolBeans,
644676
[double optionalPositional = 0.0]) {
@@ -658,7 +690,8 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
658690
fakeLibrary.classes.singleWhere((c) => c.name == 'HasGenerics');
659691
m = classB.instanceMethods.first;
660692
isGreaterThan = exLibrary.classes
661-
.singleWhere((c) => c.name == 'Apple').instanceMethods
693+
.singleWhere((c) => c.name == 'Apple')
694+
.instanceMethods
662695
.singleWhere((m) => m.name == 'isGreaterThan');
663696
m4 = classB.instanceMethods[1];
664697
m5 = klass.instanceMethods.singleWhere((m) => m.name == 'another');
@@ -722,8 +755,9 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
722755
onlySetter = LongFirstLine.instanceProperties
723756
.firstWhere((p) => p.name == 'onlySetter');
724757

725-
lengthX = fakeLibrary.classes.firstWhere(
726-
(c) => c.name == 'WithGetterAndSetter').allInstanceProperties
758+
lengthX = fakeLibrary.classes
759+
.firstWhere((c) => c.name == 'WithGetterAndSetter')
760+
.allInstanceProperties
727761
.firstWhere((c) => c.name == 'lengthX');
728762
});
729763

@@ -857,7 +891,8 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
857891

858892
setUp(() {
859893
fList = exLibrary.classes
860-
.firstWhere((c) => c.name == 'B').instanceProperties
894+
.firstWhere((c) => c.name == 'B')
895+
.instanceProperties
861896
.singleWhere((p) => p.name == 'list');
862897
});
863898

@@ -894,7 +929,8 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
894929
isGreaterThan =
895930
c.instanceMethods.singleWhere((m) => m.name == 'isGreaterThan');
896931
asyncM = exLibrary.classes
897-
.firstWhere((c) => c.name == 'Dog').instanceMethods
932+
.firstWhere((c) => c.name == 'Dog')
933+
.instanceMethods
898934
.firstWhere((m) => m.name == 'foo');
899935
intNumber = isGreaterThan.parameters.first;
900936
intCheckOptional = isGreaterThan.parameters.last;
@@ -1007,8 +1043,10 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
10071043
() => expect(forAnnotation.annotations, hasLength(1)));
10081044

10091045
test('has the right annotation', () {
1010-
expect(forAnnotation.annotations.first, equals(
1011-
'<a href="ex/ForAnnotation-class.html">ForAnnotation</a>(\'my value\')'));
1046+
expect(
1047+
forAnnotation.annotations.first,
1048+
equals(
1049+
'<a href="ex/ForAnnotation-class.html">ForAnnotation</a>(\'my value\')'));
10121050
});
10131051

10141052
test('methods has the right annotation', () {

0 commit comments

Comments
 (0)