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

Unified Diff: pkg/analyzer/test/file_system/physical_resource_provider_test.dart

Issue 1007233002: Add readAsStringSync() to File. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/file_system/physical_resource_provider_test.dart
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index 02eb20694c9afe5846abde536108c2c2f455e3f7..33ef8767ebda7534a5046a2ceeb01c87e307d182 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -102,6 +102,19 @@ class FileTest extends _BaseTest {
expect(parent.path, equals(tempPath));
}
+ void test_readAsStringSync_doesNotExist() {
+ File file = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(() {
+ file.readAsStringSync();
+ }, throwsA(_isFileSystemException));
+ }
+
+ void test_readAsStringSync_exists() {
+ new io.File(path).writeAsStringSync('abc');
+ File file = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(file.readAsStringSync(), 'abc');
+ }
+
void test_shortName() {
expect(file.shortName, 'file.txt');
}
« 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