<commit_before>#!/bin/sh

cd `dirname $0`

echo '1..2'

make 2>&1 > /dev/null

perl ./test.pl 2>&1 | sed -e 's/#     Failed test \(.*\)/#     Failed test ()/' > test.pl.out
perlstatus=$?

./test 2>&1 | sed -e 's/#     Failed test \(.*\)/#     Failed test ()/' > test.c.out
cstatus=$?

if grep "^# A diagnostic message$" test.c.out > /dev/null ; then
    echo "ok 1 - found a diagnostic message"
else
    echo "not ok 1 - found a diagnostic message"
    retval=1
fi

if grep "^# Returned: 0$" test.c.out > /dev/null ; then
    echo "ok 2 - diag() expected return value" 
else
    echo "not ok 2 - diag() expected return value" 
    retval=1
fi

if grep "^#     Failed test (.*test.c:main() at line 43)$" test.c.out > /dev/null ; then
    echo "ok 3 - 'failed test at line' diag" 
else
    echo "not ok 3 - 'failed test at line' diag" 
    retval=1
fi

if grep "^# ok() passed, and shouldn't$" test.c.out > /dev/null ; then
    echo "ok 4 - expected diag"
else
    echo "ok 4 - expected diag"
    retval=1
fi

if grep "^# Looks like you failed 1 test of 2.$" test.c.out > /dev/null ; then
    echo "ok 5 - failed 1 test"
 else
    echo "ok 5 - failed 1 test"
    retval=1
fi

sed -e '/^#/D' test.c.out > tmp
mv tmp test.c.out

diff -u test.pl.out test.c.out

if [ $? -eq 0 ]; then
	echo 'ok 1 - output is identical'
else
	retval=1
	echo 'not ok 1 - output is identical'
fi

if [ $perlstatus -eq $cstatus ]; then
	echo 'ok 2 - status code'
else
	retval=1
	echo 'not ok 2 - status code'
	echo "# perlstatus = $perlstatus"
	echo "#    cstatus = $cstatus"
fi

exit $retval
<commit_msg> r14677@t42:  nik | 2005-10-12 11:15:02 +0100  Fix a broken test from a busted merge.<commit_after>#!/bin/sh

echo '1..7'

perl $srcdir/test.pl 2>/dev/null >test.pl.out
perlstatus=$?

./test > test.c.out 2>&1
cstatus=$?

if grep "^# A diagnostic message$" test.c.out > /dev/null ; then
    echo "ok 1 - found a diagnostic message"
else
    echo "not ok 1 - found a diagnostic message"
    retval=1
fi

if grep "^# Returned: 0$" test.c.out > /dev/null ; then
    echo "ok 2 - diag() expected return value" 
else
    echo "not ok 2 - diag() expected return value" 
    retval=1
fi

if grep "^#     Failed test (.*test.c:main() at line 43)$" test.c.out > /dev/null ; then
    echo "ok 3 - 'failed test at line' diag" 
else
    echo "not ok 3 - 'failed test at line' diag" 
    retval=1
fi

if grep "^# ok() passed, and shouldn't$" test.c.out > /dev/null ; then
    echo "ok 4 - expected diag"
else
    echo "ok 4 - expected diag"
    retval=1
fi

if grep "^# Looks like you failed 1 test of 2.$" test.c.out > /dev/null ; then
    echo "ok 5 - failed 1 test"
 else
    echo "ok 5 - failed 1 test"
    retval=1
fi

sed -e '/^#/D' test.c.out > tmp
mv tmp test.c.out

diff -u test.pl.out test.c.out

if [ $? -eq 0 ]; then
	echo 'ok 6 - TAP output is identical'
else
	retval=1
	echo 'not ok 6 - TAP output is identical'
fi

if [ $perlstatus -eq $cstatus ]; then
	echo 'ok 7 - status code'
else
	retval=1
	echo 'not ok 7 - status code'
	echo "# perlstatus = $perlstatus"
	echo "#    cstatus = $cstatus"
fi

exit $retval

{'fraction_non_alphanumeric': 0.14498381877022654, 'fraction_numerical': 0.0313915857605178, 'mean_word_length': 2.4926553672316385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '4287985', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1154, 'n_words': 441}