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

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

Issue 2396423002: MemoryResourceProvider.getFolder() should not create the folder. (Closed)
Patch Set: Created 4 years, 2 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
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.memory_file_system_test; 5 library analyzer.test.file_system.memory_file_system_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:core'; 8 import 'dart:core';
9 9
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 expect(file.exists, isFalse); 616 expect(file.exists, isFalse);
617 } 617 }
618 618
619 test_getModificationTimes() async { 619 test_getModificationTimes() async {
620 File file = provider.newFile(provider.convertPath('/test.dart'), ''); 620 File file = provider.newFile(provider.convertPath('/test.dart'), '');
621 Source source = file.createSource(); 621 Source source = file.createSource();
622 List<int> times = await provider.getModificationTimes([source]); 622 List<int> times = await provider.getModificationTimes([source]);
623 expect(times, [source.modificationStamp]); 623 expect(times, [source.modificationStamp]);
624 } 624 }
625 625
626 test_getFolder_existing() async {
627 String path = provider.convertPath('/foo/bar');
628 provider.newFolder(path);
629 Folder folder = provider.getFolder(path);
630 expect(folder, isNotNull);
631 expect(folder.path, path);
632 expect(folder.exists, isTrue);
633 }
634
635 test_getFolder_notExisting() async {
636 String path = provider.convertPath('/foo/bar');
637 Folder folder = provider.getFolder(path);
638 expect(folder, isNotNull);
639 expect(folder.path, path);
640 expect(folder.exists, isFalse);
641 }
642
626 void test_getStateLocation_uniqueness() { 643 void test_getStateLocation_uniqueness() {
627 String idOne = 'one'; 644 String idOne = 'one';
628 Folder folderOne = provider.getStateLocation(idOne); 645 Folder folderOne = provider.getStateLocation(idOne);
629 expect(folderOne, isNotNull); 646 expect(folderOne, isNotNull);
630 String idTwo = 'two'; 647 String idTwo = 'two';
631 Folder folderTwo = provider.getStateLocation(idTwo); 648 Folder folderTwo = provider.getStateLocation(idTwo);
632 expect(folderTwo, isNotNull); 649 expect(folderTwo, isNotNull);
633 expect(folderTwo, isNot(equals(folderOne))); 650 expect(folderTwo, isNot(equals(folderOne)));
634 expect(provider.getStateLocation(idOne), equals(folderOne)); 651 expect(provider.getStateLocation(idOne), equals(folderOne));
635 } 652 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 return new Future.delayed(Duration.ZERO, computation); 786 return new Future.delayed(Duration.ZERO, computation);
770 } 787 }
771 788
772 _watchingFolder(String path, test(List<WatchEvent> changesReceived)) { 789 _watchingFolder(String path, test(List<WatchEvent> changesReceived)) {
773 Folder folder = provider.getResource(path); 790 Folder folder = provider.getResource(path);
774 var changesReceived = <WatchEvent>[]; 791 var changesReceived = <WatchEvent>[];
775 folder.changes.listen(changesReceived.add); 792 folder.changes.listen(changesReceived.add);
776 return test(changesReceived); 793 return test(changesReceived);
777 } 794 }
778 } 795 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/test/source/package_map_provider_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698