Index: pkg/docgen/test/generate_json_test.dart |
diff --git a/pkg/docgen/test/generate_json_test.dart b/pkg/docgen/test/generate_json_test.dart |
index 51643b1463c60606414da72e8a83af9590005913..7b603ee874fd8e39fae4c670b58c6384306e4ed3 100644 |
--- a/pkg/docgen/test/generate_json_test.dart |
+++ b/pkg/docgen/test/generate_json_test.dart |
@@ -1,9 +1,11 @@ |
import 'dart:convert'; |
import 'dart:io'; |
+ |
import 'package:path/path.dart' as p; |
import 'package:scheduled_test/descriptor.dart' as d; |
import 'package:scheduled_test/scheduled_test.dart'; |
+import 'util.dart'; |
import '../lib/docgen.dart' as dg; |
void main() { |
@@ -28,14 +30,10 @@ void main() { |
test('json output', () { |
print(d.defaultRoot); |
- d.dir('lib', [ |
- d.file('temp.dart', DART_LIBRARY_1), |
- d.file('temp2.dart', DART_LIBRARY_2), |
- d.file('temp3.dart', DART_LIBRARY_3), |
- ]).create(); |
- |
schedule(() { |
- return dg.docgen([d.defaultRoot], out: p.join(d.defaultRoot, 'docs')); |
+ var codeDir = getMultiLibraryCodePath(); |
+ expect(FileSystemEntity.isDirectorySync(codeDir), isTrue); |
+ return dg.docgen(['$codeDir/'], out: p.join(d.defaultRoot, 'docs')); |
}); |
d.dir('docs', [ |
@@ -61,85 +59,3 @@ final Matcher _isJsonMap = predicate((input) { |
return false; |
} |
}, 'Output is JSON encoded Map'); |
- |
-const String DART_LIBRARY_1 = ''' |
- library testLib; |
- import 'temp2.dart'; |
- import 'temp3.dart'; |
- export 'temp2.dart'; |
- export 'temp3.dart'; |
- |
- /** |
- * Doc comment for class [A]. |
- * |
- * Multiline Test |
- */ |
- /* |
- * Normal comment for class A. |
- */ |
- class A { |
- |
- int _someNumber; |
- |
- A() { |
- _someNumber = 12; |
- } |
- |
- A.customConstructor(); |
- |
- /** |
- * Test for linking to parameter [A] |
- */ |
- void doThis(int A) { |
- print(A); |
- } |
- } |
-'''; |
- |
-const String DART_LIBRARY_2 = ''' |
- library testLib2.foo; |
- import 'temp.dart'; |
- |
- /** |
- * Doc comment for class [B]. |
- * |
- * Multiline Test |
- */ |
- |
- /* |
- * Normal comment for class B. |
- */ |
- class B extends A { |
- |
- B(); |
- B.fooBar(); |
- |
- /** |
- * Test for linking to super |
- */ |
- int doElse(int b) { |
- print(b); |
- } |
- |
- /** |
- * Test for linking to parameter [c] |
- */ |
- void doThis(int c) { |
- print(a); |
- } |
- } |
- |
- int testFunc(int a) { |
- } |
-'''; |
- |
-const String DART_LIBRARY_3 = ''' |
- library testLib.bar; |
- import 'temp.dart'; |
- |
- /* |
- * Normal comment for class C. |
- */ |
- class C { |
- } |
-'''; |