| Index: pkg/docgen/test/single_library_test.dart
|
| diff --git a/pkg/docgen/test/single_library_test.dart b/pkg/docgen/test/single_library_test.dart
|
| index 5edaa3d2cb686c7a4fe0715fcfcf2ce09acdd663..e92c8571ac47bdef85076dd3356732d6cdab7f71 100644
|
| --- a/pkg/docgen/test/single_library_test.dart
|
| +++ b/pkg/docgen/test/single_library_test.dart
|
| @@ -18,7 +18,7 @@ main() {
|
| file.writeAsStringSync('''
|
| library test;
|
| /**
|
| - * Doc comment for class A.
|
| + * Doc comment for class [A].
|
| *
|
| * Multiline Test
|
| */
|
| @@ -27,17 +27,17 @@ main() {
|
| */
|
| class A {
|
|
|
| - /**
|
| - * Markdown _test_ for **class** [A]
|
| - */
|
| int _someNumber;
|
|
|
| A() {
|
| _someNumber = 12;
|
| }
|
|
|
| - void doThis(int a) {
|
| - print(a);
|
| + /**
|
| + * Test for linking to parameter [A]
|
| + */
|
| + void doThis(int A) {
|
| + print(A);
|
| }
|
| }
|
|
|
| @@ -79,6 +79,30 @@ main() {
|
| var variables = library.variables.values;
|
| expect(variables.every((e) => e is Variable), isTrue);
|
|
|
| + /// Testing fixReference
|
| + // Testing Doc comment for class [A].
|
| + var libraryMirror = mirrorSystem.libraries[testLibraryUri];
|
| + var classMirror = libraryMirror.classes.values.first;
|
| + var classDocComment = fixReference('A', libraryMirror,
|
| + classMirror, null).children.first.text;
|
| + expect(classDocComment == 'test.A', isTrue);
|
| +
|
| + // Test for linking to parameter [A]
|
| + var methodMirror = classMirror.methods['doThis'];
|
| + var methodParameterDocComment = fixReference('A', libraryMirror,
|
| + classMirror, methodMirror).children.first.text;
|
| + expect(methodParameterDocComment == 'test.A.doThis#A', isTrue);
|
| +
|
| + // Testing trying to refer to doThis function
|
| + var methodDocComment = fixReference('doThis', libraryMirror,
|
| + classMirror, methodMirror).children.first.text;
|
| + expect(methodDocComment == 'test.A.doThis', isTrue);
|
| +
|
| + // Testing something with no reference
|
| + var libraryDocComment = fixReference('foobar', libraryMirror,
|
| + classMirror, methodMirror).children.first.text;
|
| + expect(libraryDocComment == 'foobar', isTrue);
|
| +
|
| file.deleteSync();
|
| }));
|
| });
|
|
|