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

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

Issue 25465002: Always mark stdout as blocking when using 'print'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/print_sync_script.dart
diff --git a/tests/standalone/io/print_sync_script.dart b/tests/standalone/io/print_sync_script.dart
new file mode 100644
index 0000000000000000000000000000000000000000..752875b990ffedbcc6a2a8eb9fca25d9cfeb1eae
--- /dev/null
+++ b/tests/standalone/io/print_sync_script.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+String get bigString {
+ var buffer = new StringBuffer();
+ for (var i = 0; i < 1000; i++) {
+ buffer.write(i);
+ for (var i = 0; i < 200; i++) {
+ buffer.write('=');
+ }
+ buffer.writeln();
+ }
+ return buffer.toString();
+}
+
+main() {
+ stdout; // Be sure too mark stdout as non-blocking.
karlklose 2013/10/01 09:13:45 'too' -> 'to'.
Anders Johnsen 2013/10/01 09:16:56 Done.
+ print(bigString);
+}

Powered by Google App Engine
This is Rietveld 408576698