<commit_before>#!/usr/bin/env bash

# TODO: exit with non-zero status code when tests fail.

rm -f *.out

for testcase in test*.vim; do
  vim -N -u NONE -S $testcase -c 'quit!'                        # testFoo.vim
  testname=${testcase%.*}                                       # testFoo
  name=${testname:4}                                            # Foo
  name="$(tr '[:upper:]' '[:lower:]' <<< ${name:0:1})${name:1}" # foo
  expected=$name.ok
  actual=$name.out
  diff $expected $actual && echo "$name ok" || echo "$name failed"
done

git checkout fixture.txt
<commit_msg>Extract name manipulation.<commit_after>#!/usr/bin/env bash

# TODO: exit with non-zero status code when tests fail.

canonicalise_test_name() {
  local testname=$1                                              # testFoo.vim
  name=${testname%.*}                                            # testFoo
  name=${name:4}                                                 # Foo
  name="$(tr '[:upper:]' '[:lower:]' <<< ${name:0:1})${name:1}"  # foo
}


rm -f *.out

for testcase in test*.vim; do
  vim -N -u NONE -S $testcase -c 'quit!'
  canonicalise_test_name $testcase
  expected=$name.ok
  actual=$name.out
  diff $expected $actual && echo "$name ok" || echo "$name failed"
done

git checkout fixture.txt

{'fraction_non_alphanumeric': 0.15023474178403756, 'fraction_numerical': 0.007042253521126761, 'mean_word_length': 1.8549107142857142, 'pattern_counts': {'":': 0, '<': 9, '<?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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1591323', 'n_tokens_mistral': 412, 'n_tokens_neox': 379, 'n_words': 111}