<commit_before>﻿module ExecTests

open NUnit.Framework
open FsUnit
open System
open System.IO


let private checkErrorCode err =
    if err <> 0 then failwithf "Process failed with error %d" err

let private checkedExec = 
    Exec.Exec checkErrorCode

[<Test>]
let CheckExecOk () =
    let currDir = IoHelpers.CurrentFolder ()
    checkedExec "cmd" "/c dir >nul" currDir


[<Test>]
let CheckExecFailure () =
    let currDir = IoHelpers.CurrentFolder ()
    (fun () -> checkedExec "gloubiboulga" "" currDir |> ignore) |> should throw typeof<System.ComponentModel.Win32Exception>

<commit_msg>fix exec test on unix #46<commit_after>﻿module ExecTests

open NUnit.Framework
open FsUnit
open System
open System.IO


let private checkErrorCode err =
    if err <> 0 then failwithf "Process failed with error %d" err

let private checkedExec = 
    Exec.Exec checkErrorCode

[<Test>]
let CheckExecOk () =
    if not <| Env.IsMono() then
        let currDir = IoHelpers.CurrentFolder ()
        checkedExec "cmd" "/c dir >nul" currDir

[<Test>]
let CheckExecFailure () =
    let currDir = IoHelpers.CurrentFolder ()
    (fun () -> checkedExec "gloubiboulga" "" currDir |> ignore) |> should throw typeof<System.ComponentModel.Win32Exception>


{'fraction_non_alphanumeric': 0.0980544747081712, 'fraction_numerical': 0.0062256809338521405, 'mean_word_length': 3.272425249169435, 'pattern_counts': {'":': 0, '<': 12, '<?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': '802564', 'n_tokens_mistral': 435, 'n_tokens_neox': 403, 'n_words': 121}