| OLD | NEW |
| 1 library single_library_test; | 1 library single_library_test; |
| 2 | 2 |
| 3 import 'dart:io'; | 3 import 'dart:io'; |
| 4 | 4 |
| 5 import 'package:path/path.dart' as path; | 5 import 'package:path/path.dart' as path; |
| 6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 | 7 |
| 8 import '../lib/docgen.dart'; | 8 import '../lib/docgen.dart'; |
| 9 | 9 |
| 10 const String DART_LIBRARY = ''' | 10 const String DART_LIBRARY = ''' |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 expect(variables.every((e) => e is Variable), isTrue); | 97 expect(variables.every((e) => e is Variable), isTrue); |
| 98 | 98 |
| 99 /// Testing fixReference | 99 /// Testing fixReference |
| 100 // Testing Doc comment for class [A]. | 100 // Testing Doc comment for class [A]. |
| 101 var libraryMirror = mirrorSystem.libraries[testLibraryUri]; | 101 var libraryMirror = mirrorSystem.libraries[testLibraryUri]; |
| 102 var classMirror = libraryMirror.classes.values.first; | 102 var classMirror = libraryMirror.classes.values.first; |
| 103 var classDocComment = library.fixReference('A').children.first.text; | 103 var classDocComment = library.fixReference('A').children.first.text; |
| 104 expect(classDocComment, 'test.A'); | 104 expect(classDocComment, 'test.A'); |
| 105 | 105 |
| 106 // Test for linking to parameter [A] | 106 // Test for linking to parameter [A] |
| 107 var method = getDocgenObject(classMirror.methods['doThis']); | 107 var method = Indexable.getDocgenObject(classMirror.methods['doThis']); |
| 108 var methodParameterDocComment = method.fixReference( | 108 var methodParameterDocComment = method.fixReference( |
| 109 'A').children.first.text; | 109 'A').children.first.text; |
| 110 expect(methodParameterDocComment, 'test.A.doThis.A'); | 110 expect(methodParameterDocComment, 'test.A.doThis.A'); |
| 111 | 111 |
| 112 // Testing trying to refer to doThis function | 112 // Testing trying to refer to doThis function |
| 113 var methodDocComment = method.fixReference( | 113 var methodDocComment = method.fixReference( |
| 114 'doThis').children.first.text; | 114 'doThis').children.first.text; |
| 115 expect(methodDocComment, 'test.A.doThis'); | 115 expect(methodDocComment, 'test.A.doThis'); |
| 116 | 116 |
| 117 // Testing something with no reference | 117 // Testing something with no reference |
| 118 var libraryDocComment = method.fixReference('foobar').text; | 118 var libraryDocComment = method.fixReference('foobar').text; |
| 119 expect(libraryDocComment, 'foobar'); | 119 expect(libraryDocComment, 'foobar'); |
| 120 })).whenComplete(() => temporaryDir.deleteSync(recursive: true)); | 120 })).whenComplete(() => temporaryDir.deleteSync(recursive: true)); |
| 121 }); | 121 }); |
| 122 }); | 122 }); |
| 123 } | 123 } |
| OLD | NEW |