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

Unified Diff: pkg/analyzer/test/file_system/memory_file_system_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
Index: pkg/analyzer/test/file_system/memory_file_system_test.dart
diff --git a/pkg/analyzer/test/file_system/memory_file_system_test.dart b/pkg/analyzer/test/file_system/memory_file_system_test.dart
index cc0ad1604e52737bf9002903da46d79fbd9aa87e..83d3694623f565525fd1678f98b3262cb86a5720 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -121,6 +121,18 @@ class FileTest {
expect(parent.path, equals('/foo/bar'));
}
+ void test_readAsStringSync_doesNotExist() {
+ File file = provider.getResource('/test.txt');
+ expect(() {
+ file.readAsStringSync();
+ }, throwsA(_isFileSystemException));
+ }
+
+ void test_readAsStringSync_exists() {
+ File file = provider.newFile('/file.txt', 'abc');
+ expect(file.readAsStringSync(), 'abc');
+ }
+
void test_shortName() {
File file = provider.getResource('/foo/bar/file.txt');
expect(file.shortName, 'file.txt');

Powered by Google App Engine
This is Rietveld 408576698