Index: tests/standalone/io/file_test.dart |
diff --git a/tests/standalone/io/file_test.dart b/tests/standalone/io/file_test.dart |
index 3b8c383469b2f1d29ede4d03f6d3565e0c0ca285..4e3cc3d88948b6da6fc3d10bf0db6d95bf3b50cd 100644 |
--- a/tests/standalone/io/file_test.dart |
+++ b/tests/standalone/io/file_test.dart |
@@ -1082,6 +1082,29 @@ class FileTest { |
}); |
} |
+ static void testDoubleAsyncOperation() { |
+ asyncTestStarted(); |
+ var file = new File(Platform.executable).openSync(); |
+ var completer = new Completer(); |
+ int done = 0; |
+ bool error = false; |
+ void getLength() { |
+ file.length() |
+ .catchError((e) { error = true; }) |
+ .whenComplete(() { |
+ if (++done == 2) { |
+ asyncTestDone("testDoubleAsyncOperation"); |
+ Expect.isTrue(error); |
+ file.lengthSync(); |
+ file.closeSync(); |
+ } |
+ }); |
+ } |
+ getLength(); |
+ getLength(); |
+ Expect.throws(() => file.lengthSync()); |
+ } |
+ |
static void testLastModifiedSync() { |
var modified = new File(Platform.executable).lastModifiedSync(); |
Expect.isTrue(modified is DateTime); |
@@ -1300,6 +1323,7 @@ class FileTest { |
testRename(); |
testRenameSync(); |
testLastModified(); |
+ testDoubleAsyncOperation(); |
asyncEnd(); |
}); |
} |