OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library docgen.test.inherited_comments; | |
6 | |
7 import 'dart:convert'; | |
8 import 'dart:io'; | |
9 | |
10 import 'package:path/path.dart' as p; | |
11 import 'package:scheduled_test/descriptor.dart' as d; | |
12 import 'package:scheduled_test/scheduled_test.dart'; | |
13 | |
14 import 'util.dart'; | |
15 import '../lib/docgen.dart' as dg; | |
16 | |
17 void main() { | |
18 | |
19 setUp(() { | |
20 scheduleTempDir(); | |
21 }); | |
22 | |
23 test('inherited comments', () { | |
24 schedule(() { | |
25 var codeDir = getMultiLibraryCodePath(); | |
26 expect(FileSystemEntity.isDirectorySync(codeDir), isTrue); | |
27 return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs')); | |
28 }); | |
29 | |
30 schedule(() { | |
31 var path = p.join(d.defaultRoot, 'docs', 'dart-core.Set.json'); | |
32 var dartCoreSetJson = new File(path).readAsStringSync(); | |
33 | |
34 var dartCoreSet = JSON.decode(dartCoreSetJson) as Map<String, dynamic>; | |
35 | |
36 var toListDetails = dartCoreSet['inheritedMethods']['methods']['toList'] | |
37 as Map<String, dynamic>; | |
38 | |
39 expect(toListDetails, containsPair('comment', _TO_LIST_COMMENT)); | |
40 expect(toListDetails, containsPair('commentFrom', _TO_LIST_COMMENT_FROM)); | |
41 }); | |
42 }); | |
43 } | |
44 | |
45 const _TO_LIST_COMMENT = "<p>Creates a <a>dart:core.List</a> containing the " | |
46 "elements of this <a>dart:core.Iterable</a>.</p>\n<p>The elements are in " | |
47 "iteration order. The list is fixed-length\nif " | |
48 "<a>dart:core.Set.toList.growable</a> is false.</p>"; | |
49 const _TO_LIST_COMMENT_FROM = "dart:core.Iterable.toList"; | |
OLD | NEW |