Files
sdk/tests/standalone_2/io/socket_hang_test.dart
T
Alexander Aprelev 60bea3003d Reland "[tests] rewrite and format several tests on http"
This reverts commit af4330d382, relands original e35120cfd14ed09302596e9fa20d8e845e8e2668(in patchset 1) with fixes for the tests(in subsequent patchsets).

Change-Id: I025022d242a75ad94b3616ff78aef28b7b5f372b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180603
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-01-22 23:49:17 +00:00

30 lines
879 B
Dart

// Copyright (c) 2020, 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';
import 'package:expect/expect.dart';
// A regression test for: https://github.com/dart-lang/sdk/issues/40589
Future<void> main(List<String> args) async {
if (args.length != 0) {
for (int i = 0; i < 100000; i++) {
print('line $i');
}
print('done');
return;
} else {
// Create child process and keeps writing into stdout.
final p = await Process.start(
Platform.executable, [Platform.script.toFilePath(), 'child']);
p.stdout.drain();
p.stderr.drain();
final exitCode = await p.exitCode;
if (exitCode != 0) {
Expect.fail('process failed with ${exitCode}');
}
return;
}
}