<commit_before>@TestOn('vm')
library process_run_test_windows_test;

import 'dart:io';

import 'package:path/path.dart';
import 'package:process_run/shell_run.dart';
import 'package:test/test.dart';

void main() {
  test('compile and run exe', () async {
    var folder = Platform.isWindows ? 'windows' : 'linux';
    var exeExtension = Platform.isWindows ? '.exe' : '';
    var echoExePath = join('build', folder, 'process_run_echo$exeExtension');
    var echoExeDir = dirname(echoExePath);
    var echoExeName = basename(echoExePath);
    var shell = Shell(verbose: false);
    if (!File(echoExePath).existsSync()) {
      Directory(echoExeDir).createSync(recursive: true);
      await shell.run(
          'dart compile exe ${shellArgument(join('example', 'echo.dart'))} -o ${shellArgument(echoExePath)}');
    }
    // Try relative access
    var exePathShell = Shell(workingDirectory: echoExeDir, verbose: false);
    var lines = (await exePathShell
            .run('${shellArgument(join('.', echoExeName))} --stdout test'))
        .outLines;
    expect(lines, ['test']);

    // Without using a relative path, this should fail
    try {
      await exePathShell.run('${shellArgument(echoExeName)} --stdout test');
      fail('should fail');
    } on ShellException catch (e) {
      // print(e);
    }

    expect(lines, ['test']);
  },
      skip: !(Platform.isWindows || Platform.isLinux),
      timeout: const Timeout(Duration(minutes: 10)));<commit_msg>ci: test compile on MacOS<commit_after>@TestOn('vm')
library process_run_test_windows_test;

import 'dart:io';

import 'package:path/path.dart';
import 'package:process_run/shell_run.dart';
import 'package:test/test.dart';

void main() {
  test('compile and run exe', () async {
    var folder =
        Platform.isWindows ? 'windows' : (Platform.isMacOS ? 'macos' : 'linux');
    var exeExtension = Platform.isWindows ? '.exe' : '';
    var echoExePath = join('build', folder, 'process_run_echo$exeExtension');
    var echoExeDir = dirname(echoExePath);
    var echoExeName = basename(echoExePath);
    var shell = Shell(verbose: false);
    if (!File(echoExePath).existsSync()) {
      Directory(echoExeDir).createSync(recursive: true);
      await shell.run(
          'dart compile exe ${shellArgument(join('example', 'echo.dart'))} -o ${shellArgument(echoExePath)}');
    }
    // Try relative access
    var exePathShell = Shell(workingDirectory: echoExeDir, verbose: false);
    var lines = (await exePathShell
            .run('${shellArgument(join('.', echoExeName))} --stdout test'))
        .outLines;
    expect(lines, ['test']);

    // Without using a relative path, this should fail
    try {
      await exePathShell.run('${shellArgument(echoExeName)} --stdout test');
      fail('should fail');
    } on ShellException catch (_) {
      // print(e);
    }

    expect(lines, ['test']);
  },
      skip: !(Platform.isWindows || Platform.isLinux || Platform.isMacOS),
      timeout: const Timeout(Duration(minutes: 10)));
{'fraction_non_alphanumeric': 0.15361546151282907, 'fraction_numerical': 0.0013328890369876708, 'mean_word_length': 3.6979655712050077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2189654', 'n_tokens_mistral': 960, 'n_tokens_neox': 945, 'n_words': 213}