OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library docgen.test.inherited_comments; | 5 library docgen.test.inherited_comments; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
(...skipping 10 matching lines...) Expand all Loading... |
21 }); | 21 }); |
22 | 22 |
23 test('inherited comments', () { | 23 test('inherited comments', () { |
24 schedule(() { | 24 schedule(() { |
25 var codeDir = getMultiLibraryCodePath(); | 25 var codeDir = getMultiLibraryCodePath(); |
26 expect(FileSystemEntity.isDirectorySync(codeDir), isTrue); | 26 expect(FileSystemEntity.isDirectorySync(codeDir), isTrue); |
27 return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs')); | 27 return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs')); |
28 }); | 28 }); |
29 | 29 |
30 schedule(() { | 30 schedule(() { |
31 var path = p.join(d.defaultRoot, 'docs', 'dart:core.Set.json'); | 31 var path = p.join(d.defaultRoot, 'docs', 'dart-core.Set.json'); |
32 var dartCoreSetJson = new File(path).readAsStringSync(); | 32 var dartCoreSetJson = new File(path).readAsStringSync(); |
33 | 33 |
34 var dartCoreSet = JSON.decode(dartCoreSetJson) as Map<String, dynamic>; | 34 var dartCoreSet = JSON.decode(dartCoreSetJson) as Map<String, dynamic>; |
35 | 35 |
36 var toListDetails = dartCoreSet['inheritedMethods']['methods']['toList'] | 36 var toListDetails = dartCoreSet['inheritedMethods']['methods']['toList'] |
37 as Map<String, dynamic>; | 37 as Map<String, dynamic>; |
38 | 38 |
39 expect(toListDetails, containsPair('comment', _TO_LIST_COMMENT)); | 39 expect(toListDetails, containsPair('comment', _TO_LIST_COMMENT)); |
40 expect(toListDetails, containsPair('commentFrom', _TO_LIST_COMMENT_FROM)); | 40 expect(toListDetails, containsPair('commentFrom', _TO_LIST_COMMENT_FROM)); |
41 }); | 41 }); |
42 }); | 42 }); |
43 } | 43 } |
44 | 44 |
45 const _TO_LIST_COMMENT = "<p>Creates a <a>dart:core.List</a> containing the " | 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 " | 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 " | 47 "iteration order. The list is fixed-length\nif " |
48 "<a>dart:core.Set.toList.growable</a> is false.</p>"; | 48 "<a>dart:core.Set.toList.growable</a> is false.</p>"; |
49 const _TO_LIST_COMMENT_FROM = "dart:core.Iterable.toList"; | 49 const _TO_LIST_COMMENT_FROM = "dart:core.Iterable.toList"; |
OLD | NEW |