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

Unified Diff: tests/standalone/io/file_copy_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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: tests/standalone/io/file_copy_test.dart
diff --git a/tests/standalone/io/file_copy_test.dart b/tests/standalone/io/file_copy_test.dart
index 2ef7358dd53161624dad4664ed4450656111f7f5..2302a4a037b65e38bee4750a8ffad861c4b2083f 100644
--- a/tests/standalone/io/file_copy_test.dart
+++ b/tests/standalone/io/file_copy_test.dart
@@ -38,7 +38,6 @@ void testCopySync() {
tmp.deleteSync(recursive: true);
}
-
void testCopy() {
asyncStart();
var tmp = Directory.systemTemp.createTempSync('dart-file-copy');
@@ -48,38 +47,32 @@ void testCopy() {
Expect.equals(FILE_CONTENT1, file1.readAsStringSync());
// Copy to new file works.
- file1.copy('${tmp.path}/file2')
- .then((file2) {
- Expect.equals(FILE_CONTENT1, file1.readAsStringSync());
- Expect.equals(FILE_CONTENT1, file2.readAsStringSync());
-
- // Override works for files.
- file2.writeAsStringSync(FILE_CONTENT2);
- return file2.copy(file1.path)
- .then((_) {
- Expect.equals(FILE_CONTENT2, file1.readAsStringSync());
- Expect.equals(FILE_CONTENT2, file2.readAsStringSync());
-
- // Fail when coping to directory.
- var dir = new Directory('${tmp.path}/dir')..createSync();
-
- return file1.copy(dir.path)
- .then((_) => Expect.fail('expected error'),
- onError: (_) {})
- .then((_) {
- Expect.equals(FILE_CONTENT2, file1.readAsStringSync());
- });
-
- });
- })
- .whenComplete(() {
- tmp.deleteSync(recursive: true);
- asyncEnd();
+ file1.copy('${tmp.path}/file2').then((file2) {
+ Expect.equals(FILE_CONTENT1, file1.readAsStringSync());
+ Expect.equals(FILE_CONTENT1, file2.readAsStringSync());
+
+ // Override works for files.
+ file2.writeAsStringSync(FILE_CONTENT2);
+ return file2.copy(file1.path).then((_) {
+ Expect.equals(FILE_CONTENT2, file1.readAsStringSync());
+ Expect.equals(FILE_CONTENT2, file2.readAsStringSync());
+
+ // Fail when coping to directory.
+ var dir = new Directory('${tmp.path}/dir')..createSync();
+
+ return file1
+ .copy(dir.path)
+ .then((_) => Expect.fail('expected error'), onError: (_) {})
+ .then((_) {
+ Expect.equals(FILE_CONTENT2, file1.readAsStringSync());
+ });
});
-
+ }).whenComplete(() {
+ tmp.deleteSync(recursive: true);
+ asyncEnd();
+ });
}
-
main() {
testCopySync();
testCopy();

Powered by Google App Engine
This is Rietveld 408576698