| 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 5c931b144489e8ba1ae3bcb187f4b4fd9d9d3159..2ee57753d04e487af650dc33206b92091ed1d43f 100644
|
| --- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
|
| +++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
|
| @@ -211,20 +211,43 @@ class FileTest {
|
| }
|
|
|
| void test_writeAsBytesSync_existing() {
|
| - File file = provider.newFileWithBytes('/foo/file.bin', <int>[1, 2]);
|
| - expect(file.readAsBytesSync(), <int>[1, 2]);
|
| + List<int> content = <int>[1, 2];
|
| + File file = provider.newFileWithBytes('/foo/file.bin', 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_writeAsBytesSync_new() {
|
| File file = provider.getFile('/foo/file.bin');
|
| expect(file.exists, false);
|
| // write new bytes
|
| - file.writeAsBytesSync(<int>[10, 20]);
|
| + List<int> content = <int>[10, 20];
|
| + file.writeAsBytesSync(content);
|
| expect(file.exists, true);
|
| - expect(file.readAsBytesSync(), <int>[10, 20]);
|
| + expect(file.readAsBytesSync(), content);
|
| + }
|
| +
|
| + void test_writeAsStringSync_existing() {
|
| + String content = 'ab';
|
| + File file = provider.newFile('/foo/file.txt', content);
|
| + expect(file.readAsStringSync(), content);
|
| + // write new bytes
|
| + content = 'CD';
|
| + file.writeAsStringSync(content);
|
| + expect(file.readAsStringSync(), content);
|
| + }
|
| +
|
| + void test_writeAsStringSync_new() {
|
| + File file = provider.getFile('/foo/file.txt');
|
| + expect(file.exists, false);
|
| + // write new bytes
|
| + String content = 'ef';
|
| + file.writeAsStringSync(content);
|
| + expect(file.exists, true);
|
| + expect(file.readAsStringSync(), content);
|
| }
|
| }
|
|
|
|
|