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

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

Issue 2265593002: Add writeAsStringSync (issue 27109) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
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 a7c7c1f089e5708021d11c47c1f480e36e043011..88bd9615299ef7071e7c1af16262660aedce18ae 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -195,11 +195,23 @@ class FileTest extends _BaseTest {
}
void test_writeAsBytesSync() {
- new io.File(path).writeAsBytesSync(<int>[1, 2]);
- expect(file.readAsBytesSync(), <int>[1, 2]);
+ List<int> content = <int>[1, 2];
+ new io.File(path).writeAsBytesSync(content);
+ expect(file.readAsBytesSync(), content);
// write new bytes
- file.writeAsBytesSync(<int>[10, 20]);
- expect(file.readAsBytesSync(), <int>[10, 20]);
+ content = <int>[10, 20];
+ file.writeAsBytesSync(content);
+ expect(file.readAsBytesSync(), content);
+ }
+
+ void test_writeAsStringSync() {
+ String content = 'ab';
+ new io.File(path).writeAsStringSync(content);
+ expect(file.readAsStringSync(), content);
+ // write new bytes
+ content = 'CD';
+ file.writeAsStringSync(content);
+ expect(file.readAsStringSync(), content);
}
}

Powered by Google App Engine
This is Rietveld 408576698