<commit_before>#!/bin/bash

runTest() {
    module=$1
    quiet=$2
    echo "Running test $module..."

    ghc_output=`runghc -DTEST_MODULE=$module TestDriver.hs`

    if [[ $quiet == 1 ]] ; then
        hastec --start=asap -DTEST_MODULE=$module TestDriver.hs > /dev/null 2>&1
    else
        hastec --verbose --debug --start=asap -DTEST_MODULE=$module TestDriver.hs
    fi
    haste_output=`js TestDriver.js`

    if [[ $quiet == 1 ]] ; then
        hastec -O2 --start=asap -DO2 -DTEST_MODULE=$module TestDriver.hs > /dev/null 2>&1
    else
        hastec -O2 --verbose --debug --start=asap -DO2 -DTEST_MODULE=$module TestDriver.hs
    fi
    haste_opt_output=`js TestDriver.js`

    if [[ "$ghc_output" != "$haste_output" ]] ; then
        thistest="failed"
        echo "  GHC disagrees with hastec output!"
        echo "  GHC says '$ghc_output', but hastec says '$haste_output'"
    fi

    if [[ "$ghc_output" != "$haste_opt_output" ]] ; then
        thistest="failed"
        echo "  GHC disagrees with hastec -O2 output!"
        echo "  GHC says '$ghc_output', but hastec says '$haste_opt_output'"
    fi
}

if [[ "$1" != "" ]] ; then
    runTest $1 0
    exit 0
fi

let failed=0
let tests=0
<commit_msg>Save both -O2 and -O0 files after running runtests.sh.<commit_after>#!/bin/bash

runTest() {
    module=$1
    quiet=$2
    echo "Running test $module..."

    ghc_output=`runghc -DTEST_MODULE=$module TestDriver.hs`

    if [[ $quiet == 1 ]] ; then
        hastec --start=asap -DTEST_MODULE=$module TestDriver.hs > /dev/null 2>&1
    else
        hastec --verbose --debug --start=asap -DTEST_MODULE=$module TestDriver.hs
    fi
    haste_output=`js TestDriver.js`

    if [[ $quiet == 1 ]] ; then
        hastec -O2 --start=asap -DO2 -DTEST_MODULE=$module --out=TestDriver.O2.js TestDriver.hs > /dev/null 2>&1
    else
        hastec -O2 --verbose --debug --start=asap -DO2 -DTEST_MODULE=$module --out=TestDriver.O2.js TestDriver.hs
    fi
    haste_opt_output=`js TestDriver.O2.js`

    if [[ "$ghc_output" != "$haste_output" ]] ; then
        thistest="failed"
        echo "  GHC disagrees with hastec output!"
        echo "  GHC says '$ghc_output', but hastec says '$haste_output'"
    fi

    if [[ "$ghc_output" != "$haste_opt_output" ]] ; then
        thistest="failed"
        echo "  GHC disagrees with hastec -O2 output!"
        echo "  GHC says '$ghc_output', but hastec says '$haste_opt_output'"
    fi
}

if [[ "$1" != "" ]] ; then
    runTest $1 0
    exit 0
fi

let failed=0
let tests=0

{'fraction_non_alphanumeric': 0.14416203335980937, 'fraction_numerical': 0.017077045274027005, 'mean_word_length': 2.537921348314607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4062073', 'n_tokens_mistral': 945, 'n_tokens_neox': 900, 'n_words': 228}