<commit_before>// Copyright (c) 2017, 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.

/// @assertion
/// Future<ProcessResult> run(
///     String executable,
///     List<String> arguments, {
///     String workingDirectory,
///     Map<String, String> environment,
///     bool includeParentEnvironment: true,
///     bool runInShell: false,
///     Encoding stdoutEncoding: systemEncoding,
///     Encoding stderrEncoding: systemEncoding
/// })
///
/// Starts a process and runs it non-interactively to completion. The process
/// run is executable with the specified arguments.
/// ...
/// Returns a Future<ProcessResult> that completes with the result of running
/// the process, i.e., exit code, standard out and standard in.
///
/// @description Checks that static method [run] starts a process, runs it
/// non-interactively to completion and returns a Future<ProcessResult> that
/// completes with the result of running the process, i.e., exit code, standard
/// out and standard in. Tests dart process which exits correctly with exit code
/// 16.
/// @author <EMAIL>
/// @issue 31611

import "dart:io";
import "../../../Utils/expect.dart";

runMain() {
  String executable = Platform.resolvedExecutable;
  String eScript = Platform.script.toString();

  asyncStart();
  Process.run(executable, [...Platform.executableArguments, eScript, "run"])
      .then((ProcessResult results) {
    Expect.equals(16, results.exitCode);
    Expect.equals("Lily was here", results.stdout);
    Expect.equals("", results.stderr);
    asyncEnd();
  });
}

runProcess() {
  stdout.write("Lily was here");
  exit(16);
}

main(List<String> args) {
  if (args.length > 0)
    runProcess();
  else {<commit_msg>More fix for #1094: LibTestCopyrights updated in LibTest/io/Process test.<commit_after>// Copyright (c) 2021, 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.

/// @assertion
/// Future<ProcessResult> run(
///     String executable,
///     List<String> arguments, {
///     String workingDirectory,
///     Map<String, String> environment,
///     bool includeParentEnvironment: true,
///     bool runInShell: false,
///     Encoding stdoutEncoding: systemEncoding,
///     Encoding stderrEncoding: systemEncoding
/// })
///
/// Starts a process and runs it non-interactively to completion. The process
/// run is executable with the specified arguments.
/// ...
/// Returns a Future<ProcessResult> that completes with the result of running
/// the process, i.e., exit code, standard out and standard in.
///
/// @description Checks that static method [run] starts a process, runs it
/// non-interactively to completion and returns a Future<ProcessResult> that
/// completes with the result of running the process, i.e., exit code, standard
/// out and standard in. Tests dart process which exits correctly with exit code
/// 16.
/// @author <EMAIL>
/// @issue 31611

import "dart:io";
import "../../../Utils/expect.dart";

runMain() {
  String executable = Platform.resolvedExecutable;
  String eScript = Platform.script.toString();

  asyncStart();
  Process.run(executable, [...Platform.executableArguments, eScript, "run"])
      .then((ProcessResult results) {
    Expect.equals(16, results.exitCode);
    Expect.equals("Lily was here", results.stdout);
    Expect.equals("", results.stderr);
    asyncEnd();
  });
}

runProcess() {
  stdout.write("Lily was here");
  exit(16);
}

main(List<String> args) {
  if (args.length > 0)
    runProcess();
  else {
{'fraction_non_alphanumeric': 0.13672707889125799, 'fraction_numerical': 0.009594882729211088, 'mean_word_length': 3.2263513513513513, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6941209', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1023, 'n_words': 382}