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

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

Issue 2058163002: Add Folder.getChildAssumingFile(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « pkg/analyzer/test/file_system/memory_file_system_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 analyzer.test.file_system.physical_resource_provider_test; 5 library analyzer.test.file_system.physical_resource_provider_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:core' hide Resource; 8 import 'dart:core' hide Resource;
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 expect(child.exists, isTrue); 247 expect(child.exists, isTrue);
248 } 248 }
249 249
250 void test_getChild_folder() { 250 void test_getChild_folder() {
251 new io.Directory(join(path, 'myFolder')).createSync(); 251 new io.Directory(join(path, 'myFolder')).createSync();
252 var child = folder.getChild('myFolder'); 252 var child = folder.getChild('myFolder');
253 expect(child, _isFolder); 253 expect(child, _isFolder);
254 expect(child.exists, isTrue); 254 expect(child.exists, isTrue);
255 } 255 }
256 256
257 void test_getChildAssumingFile_doesNotExist() {
258 File child = folder.getChildAssumingFile('no-such-resource');
259 expect(child, isNotNull);
260 expect(child.exists, isFalse);
261 }
262
263 void test_getChildAssumingFile_file() {
264 new io.File(join(path, 'myFile')).createSync();
265 File child = folder.getChildAssumingFile('myFile');
266 expect(child, isNotNull);
267 expect(child.exists, isTrue);
268 }
269
270 void test_getChildAssumingFile_folder() {
271 new io.Directory(join(path, 'myFolder')).createSync();
272 File child = folder.getChildAssumingFile('myFolder');
273 expect(child, isNotNull);
274 expect(child.exists, isFalse);
275 }
276
257 void test_getChildAssumingFolder_doesNotExist() { 277 void test_getChildAssumingFolder_doesNotExist() {
258 Folder child = folder.getChildAssumingFolder('no-such-resource'); 278 Folder child = folder.getChildAssumingFolder('no-such-resource');
259 expect(child, isNotNull); 279 expect(child, isNotNull);
260 expect(child.exists, isFalse); 280 expect(child.exists, isFalse);
261 } 281 }
262 282
263 void test_getChildAssumingFolder_file() { 283 void test_getChildAssumingFolder_file() {
264 new io.File(join(path, 'myFile')).createSync(); 284 new io.File(join(path, 'myFile')).createSync();
265 Folder child = folder.getChildAssumingFolder('myFile'); 285 Folder child = folder.getChildAssumingFolder('myFile');
266 expect(child, isNotNull); 286 expect(child, isNotNull);
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 526
507 setUp() { 527 setUp() {
508 tempDirectory = io.Directory.systemTemp.createTempSync('test_resource'); 528 tempDirectory = io.Directory.systemTemp.createTempSync('test_resource');
509 tempPath = tempDirectory.absolute.path; 529 tempPath = tempDirectory.absolute.path;
510 } 530 }
511 531
512 tearDown() { 532 tearDown() {
513 tempDirectory.deleteSync(recursive: true); 533 tempDirectory.deleteSync(recursive: true);
514 } 534 }
515 } 535 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/file_system/memory_file_system_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698