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

Side by Side Diff: sdk/lib/_internal/dartdoc/test/export_map_test.dart

Issue 16848002: Add toUri and fromUri functions to pathos. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Preserve trailing separators. Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'package:pathos/path.dart' as pathos; 7 import 'package:pathos/path.dart' as pathos;
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import '../lib/src/export_map.dart'; 10 import '../lib/src/export_map.dart';
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 test('merging hide + hide takes the intersection', () { 366 test('merging hide + hide takes the intersection', () {
367 expect(new Export('', '', hide: ['x', 'y']) 367 expect(new Export('', '', hide: ['x', 'y'])
368 .merge(new Export('', '', hide: ['y', 'z'])), 368 .merge(new Export('', '', hide: ['y', 'z'])),
369 equals(new Export('', '', hide: ['y']))); 369 equals(new Export('', '', hide: ['y'])));
370 }); 370 });
371 }); 371 });
372 } 372 }
373 373
374 ExportMap parse(List<String> libraries) { 374 ExportMap parse(List<String> libraries) {
375 return new ExportMap.parse( 375 return new ExportMap.parse(
376 libraries.map(libPath) 376 libraries.map(libPath).map(pathos.toUri),
377 .map(pathToFileUri),
378 pathos.join(tempDir, 'packages')); 377 pathos.join(tempDir, 'packages'));
379 } 378 }
380 379
381 void createLibrary(String name, [String contents]) { 380 void createLibrary(String name, [String contents]) {
382 if (contents == null) contents = ''; 381 if (contents == null) contents = '';
383 new Directory(pathos.dirname(libPath(name))).createSync(recursive: true); 382 new Directory(pathos.dirname(libPath(name))).createSync(recursive: true);
384 new File(libPath(name)).writeAsStringSync(''' 383 new File(libPath(name)).writeAsStringSync('''
385 library ${pathos.basename(name)}; 384 library ${pathos.basename(name)};
386 $contents 385 $contents
387 '''); 386 ''');
388 } 387 }
389 388
390 String libPath(String name) => pathos.normalize(pathos.join(tempDir, name)); 389 String libPath(String name) => pathos.normalize(pathos.join(tempDir, name));
391 390
392 void createTempDir() { 391 void createTempDir() {
393 tempDir = new Directory('').createTempSync().path; 392 tempDir = new Directory('').createTempSync().path;
394 new Directory(pathos.join(tempDir, 'packages')).createSync(); 393 new Directory(pathos.join(tempDir, 'packages')).createSync();
395 } 394 }
396 395
397 void deleteTempDir() { 396 void deleteTempDir() {
398 new Directory(tempDir).deleteSync(recursive: true); 397 new Directory(tempDir).deleteSync(recursive: true);
399 } 398 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/dartdoc/lib/src/dartdoc/utils.dart ('k') | sdk/lib/_internal/pub/lib/src/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698