Skip to content

Commit f36c0fd

Browse files
committed
upgrade analyzer, add more tests, skip tests we don't have a solution for right now
1 parent d8a730d commit f36c0fd

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed

lib/markdown_processor.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import 'package:markdown/markdown.dart' as md;
2222
import 'src/html_utils.dart' show htmlEscape;
2323
import 'src/model.dart';
2424

25-
import 'src/debug.dart';
26-
2725
final List<md.InlineSyntax> _markdown_syntaxes = [new _InlineCodeSyntax()];
2826

2927
// We don't emit warnings currently: #572.
@@ -86,7 +84,6 @@ class Documentation {
8684

8785
String renderMarkdownToHtml(String text, [ModelElement element]) {
8886
md.Node _linkResolver(String name) {
89-
debugger(when: element != null && element.name == 'doAwesomeStuff');
9087
NodeList<CommentReference> commentRefs = _getCommentRefs(element);
9188
return new md.Text(_linkDocReference(name, element, commentRefs));
9289
}
@@ -149,7 +146,6 @@ NodeList<CommentReference> _getCommentRefs(ModelElement modelElement) {
149146
String _getMatchingLink(
150147
String codeRef, ModelElement element, List<CommentReference> commentRefs,
151148
{bool isConstructor: false}) {
152-
debugger(when: element != null && element.name == 'doAwesomeStuff');
153149
if (commentRefs == null) return null;
154150

155151
Element refElement;

pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ packages:
44
analyzer:
55
description: analyzer
66
source: hosted
7-
version: "0.25.2"
7+
version: "0.26.0"
88
ansicolor:
99
description: ansicolor
1010
source: hosted
@@ -88,7 +88,7 @@ packages:
8888
markdown:
8989
description: markdown
9090
source: hosted
91-
version: "0.7.1+2"
91+
version: "0.7.1+3"
9292
matcher:
9393
description: matcher
9494
source: hosted
@@ -148,7 +148,7 @@ packages:
148148
shelf_static:
149149
description: shelf_static
150150
source: hosted
151-
version: "0.2.2"
151+
version: "0.2.3"
152152
shelf_web_socket:
153153
description: shelf_web_socket
154154
source: hosted
@@ -180,7 +180,7 @@ packages:
180180
test:
181181
description: test
182182
source: hosted
183-
version: "0.12.3+8"
183+
version: "0.12.3+9"
184184
unscripted:
185185
description: unscripted
186186
source: hosted

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ homepage: https://github.com/dart-lang/dartdoc
77
environment:
88
sdk: '>=1.9.0 <2.0.0' # when we go to 1.12, bump analyzer version
99
dependencies:
10-
analyzer: ^0.25.0
10+
analyzer: '>=0.25.0 <0.27.0'
1111
args: ^0.13.0
1212
cli_util: ^0.0.1
1313
html: ^0.12.1

test/model_test.dart

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,19 @@ void main() {
228228
'<a href="fake/BaseForDocComments-class.html">BaseForDocComments</a>'));
229229
});
230230

231-
test('links to a reference to a top-level const', () {
231+
test(
232+
'links to a reference to a top-level const with multiple underscores',
233+
() {
232234
expect(
233235
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]'));
234244
});
235245

236246
test('links to a method in this class', () {
@@ -263,20 +273,24 @@ void main() {
263273
contains('<a href="">css.theOnlyThingInTheLibrary</a>'));
264274
}, skip: 'Wait for https://github.com/dart-lang/dartdoc/issues/767 to be fixed');
265275

276+
// remove this test when the above test is fixed. just here to
277+
// track when the behavior changes
266278
test('codeifies a prefixed top-level variable an imported lib', () {
267279
expect(docsAsHtml, contains(
268280
'<code class="prettyprint lang-dart">css.theOnlyThingInTheLibrary</code>'));
269281
});
282+
283+
test('links to a name with a single underscore', () {
284+
expect(docsAsHtml, contains(
285+
'<a href="fake/NAME_SINGLEUNDERSCORE.html">NAME_SINGLEUNDERSCORE</a>'));
286+
});
270287
});
271288

272289
test('multi-underscore names in brackets do not become italicized', () {
273290
expect(short.documentation, contains('[NAME_WITH_TWO_UNDERSCORES]'));
274-
expect(short.documentation, contains('[NAME_SINGLEUNDERSCORE]'));
275291
expect(short.documentationAsHtml, contains(
276292
'<a href="fake/NAME_WITH_TWO_UNDERSCORES.html">NAME_WITH_TWO_UNDERSCORES</a>'));
277-
expect(short.documentationAsHtml, contains(
278-
'<a href="fake/NAME_SINGLEUNDERSCORE.html">NAME_SINGLEUNDERSCORE</a>'));
279-
});
293+
}, skip: 'Wait for https://github.com/dart-lang/dartdoc/issues/768');
280294

281295
test('still has brackets inside code blocks', () {
282296
expect(topLevelFunction.documentationAsHtml,

test_package/lib/fake.dart

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,23 +386,25 @@ class ExtraSpecialList<E> extends SpecialList {}
386386
class BaseForDocComments {
387387
/// Takes a [value] and returns a String.
388388
///
389-
/// This methods is inside of [BaseForDocComments] class
389+
/// This methods is inside of [BaseForDocComments] class xx
390390
///
391-
/// Also [NAME_WITH_TWO_UNDERSCORES] which is a top-level const
391+
/// Also [NAME_WITH_TWO_UNDERSCORES] which is a top-level const xx
392392
///
393-
/// Returns a [String]
393+
/// Also a single underscore: [NAME_SINGLEUNDERSCORE]
394394
///
395-
/// Reference to another method in this class [anotherMethod]
395+
/// Returns a [String] xx
396396
///
397-
/// Reference to a top-level function in this library [topLevelFunction]
397+
/// Reference to another method in this class [anotherMethod] xx
398398
///
399-
/// Reference to a top-level function in another library (example lib) [function1]
399+
/// Reference to a top-level function in this library [topLevelFunction] xx
400400
///
401-
/// Reference to a class in example lib [Apple]
401+
/// Reference to a top-level function in another library (example lib) [function1] xx
402402
///
403-
/// Reference to a top-level const in another library [incorrectDocReference]
403+
/// Reference to a class in example lib [Apple] xx
404404
///
405-
/// Reference to prefixed-name from another lib [css.theOnlyThingInTheLibrary]
405+
/// Reference to a top-level const in another library [incorrectDocReference] xx
406+
///
407+
/// Reference to prefixed-name from another lib [css.theOnlyThingInTheLibrary] xx
406408
String doAwesomeStuff(int value) => null;
407409

408410
void anotherMethod() {}

0 commit comments

Comments
 (0)