<commit_before>#!/bin/bash

set -o errexit
set -o nounset

# Run script to test, should output something like

# test zsh pipe
# test bash pipe
# test zsh file
# test bash file

# Missing lines are failures


# command to load the function and the mock for _emacsfun
loadcmd="source $(pwd)/emacs-read-stdin.sh && source $(pwd)/test-mocks.sh"


function test_pipe
{
    shell="$1"
    shift
    $shell $@ -e -u -c "$loadcmd && echo test $shell pipe | e -"
}
test_pipe zsh -f 
test_pipe bash -norc


function test_file
{
    shell="$1"
    shift
    $shell $@ -e -u -c "$loadcmd && echo test $shell file > temp && e temp && rm temp"
}
test_file zsh -f
test_file bash -norc<commit_msg>Add tests for dash shell<commit_after>#!/bin/bash

set -o errexit
set -o nounset

# Run script to test, should output something like

# test zsh pipe
# test bash pipe
# test dash pipe
# test zsh file
# test bash file
# test dash file

# Missing lines are failures


# command to load the function and the mock for _emacsfun
loadcmd=". $(pwd)/emacs-read-stdin.sh && . $(pwd)/test-mocks.sh"


function test_pipe
{
    shell="$1"
    shift
    $shell "$@" -e -u -c "$loadcmd && echo test $shell pipe | e -"
}
test_pipe zsh -f 
test_pipe bash -norc
test_pipe dash


function test_file
{
    shell="$1"
    shift
    $shell "$@" -e -u -c "$loadcmd && echo test $shell file > temp && e temp && rm temp"
}
test_file zsh -f
test_file bash -norc
test_file dash
{'fraction_non_alphanumeric': 0.12002791346824843, 'fraction_numerical': 0.0027913468248429866, 'mean_word_length': 3.0854700854700856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1817741', 'n_tokens_mistral': 531, 'n_tokens_neox': 505, 'n_words': 190}