Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: pkg/docgen/test/generate_json_test.dart

Issue 172873002: pkg/docgen: putting test code in file system (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/docgen/test/multi_library_code/lib/temp.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
- }
-''';
« no previous file with comments | « no previous file | pkg/docgen/test/multi_library_code/lib/temp.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698