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

Side by Side Diff: pkg/docgen/test/util.dart

Issue 1364553002: remove docgen source and targets from build (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: remove scripts Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « pkg/docgen/test/typedef_test.dart ('k') | sdk/bin/dartdocgen » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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.util;
6
7 import 'dart:convert';
8 import 'dart:io';
9 import 'package:path/path.dart' as p;
10 import 'package:scheduled_test/descriptor.dart' as d;
11 import 'package:scheduled_test/scheduled_test.dart';
12
13 void scheduleTempDir() {
14 var tempDir;
15 schedule(() {
16 return Directory.systemTemp
17 .createTemp('docgen_test-')
18 .then((dir) {
19 tempDir = dir;
20 d.defaultRoot = tempDir.path;
21 });
22 });
23
24 currentSchedule.onComplete.schedule(() {
25 d.defaultRoot = null;
26 return tempDir.delete(recursive: true);
27 });
28 }
29
30 String getMultiLibraryCodePath() {
31 var currentScript = p.fromUri(Platform.script);
32 var codeDir = p.join(p.dirname(currentScript), 'multi_library_code');
33
34 assert(FileSystemEntity.isDirectorySync(codeDir));
35
36 return codeDir;
37 }
38
39 final Matcher hasSortedLines = predicate((String input) {
40 var lines = new LineSplitter().convert(input);
41
42 var sortedLines = new List.from(lines)..sort();
43
44 var orderedMatcher = orderedEquals(sortedLines);
45 return orderedMatcher.matches(lines, {});
46 }, 'String has sorted lines');
47
48 final Matcher isJsonMap = predicate((input) {
49 try {
50 return JSON.decode(input) is Map;
51 } catch (e) {
52 return false;
53 }
54 }, 'Output is JSON encoded Map');
OLDNEW
« no previous file with comments | « pkg/docgen/test/typedef_test.dart ('k') | sdk/bin/dartdocgen » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698