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

Side by Side Diff: pkg/analyzer/test/file_system/memory_file_system_test.dart

Issue 444193002: Add Folder.contains(path) and use it in ContextDirectoryManager. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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) 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 test.memory_file_system; 5 library test.memory_file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/src/generated/engine.dart' show TimestampedData; 9 import 'package:analyzer/src/generated/engine.dart' show TimestampedData;
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 Folder folder2 = provider.getResource(path); 296 Folder folder2 = provider.getResource(path);
297 expect(folder == folder2, isTrue); 297 expect(folder == folder2, isTrue);
298 }); 298 });
299 299
300 test('equality: different paths', () { 300 test('equality: different paths', () {
301 String path2 = '/foo/baz'; 301 String path2 = '/foo/baz';
302 Folder folder2 = provider.newFolder(path2); 302 Folder folder2 = provider.newFolder(path2);
303 expect(folder == folder2, isFalse); 303 expect(folder == folder2, isFalse);
304 }); 304 });
305 305
306 test('contains', () {
307 expect(folder.contains('/foo/bar/aaa.txt'), isTrue);
308 expect(folder.contains('/foo/bar/aaa/bbb.txt'), isTrue);
309 expect(folder.contains('/baz.txt'), isFalse);
310 expect(folder.contains('/foo/bar'), isFalse);
311 });
312
306 group('getChild', () { 313 group('getChild', () {
307 test('does not exist', () { 314 test('does not exist', () {
308 File file = folder.getChild('file.txt'); 315 File file = folder.getChild('file.txt');
309 expect(file, isNotNull); 316 expect(file, isNotNull);
310 expect(file.exists, isFalse); 317 expect(file.exists, isFalse);
311 }); 318 });
312 319
313 test('file', () { 320 test('file', () {
314 provider.newFile('/foo/bar/file.txt', 'content'); 321 provider.newFile('/foo/bar/file.txt', 'content');
315 File child = folder.getChild('file.txt'); 322 File child = folder.getChild('file.txt');
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 }); 476 });
470 477
471 test('resolveRelative', () { 478 test('resolveRelative', () {
472 Uri relative = source.resolveRelativeUri(new Uri.file('bar/baz.dart')) ; 479 Uri relative = source.resolveRelativeUri(new Uri.file('bar/baz.dart')) ;
473 expect(relative.path, '/foo/bar/baz.dart'); 480 expect(relative.path, '/foo/bar/baz.dart');
474 }); 481 });
475 }); 482 });
476 }); 483 });
477 }); 484 });
478 } 485 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698