<commit_before>#!/bin/sh

for f in tests/*/; do
	string="Test ${f%?}"
	result="$(./${f}test.swift)"
	expected="$(<${f}result.txt)"
	if [ "${result##*( )}" == "$expected" ]; then
		echo "\033[0;32m✓ $string\033[0m"
	else
		echo "\033[0;31m✗ $string\033[0m"
		echo "Expected:"
		echo $expected
		echo "Actual result:"
		echo $result
	fi
done<commit_msg>Fail build on test failure<commit_after>#!/bin/sh

result=0

for f in tests/*/; do
	string="Test ${f%?}"
	result="$(./${f}test.swift)"
	expected="$(<${f}result.txt)"
	if [ "${result##*( )}" == "$expected" ]; then
		echo "\033[0;32m✓ $string\033[0m"
	else
		echo "\033[0;31m✗ $string\033[0m"
		echo "Expected:"
		echo $expected
		echo "Actual result:"
		echo $result
		result=1
	fi
done

exit $result
{'fraction_non_alphanumeric': 0.23333333333333334, 'fraction_numerical': 0.056, 'mean_word_length': 4.179310344827586, 'pattern_counts': {'":': 0, '<': 5, '<?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': '873967', 'n_tokens_mistral': 351, 'n_tokens_neox': 311, 'n_words': 71}