<commit_before># Test that the cat command behaves as expected.

export REPO_PATH=`pwd`/TESTREPO
$BOAR mkrepo $REPO_PATH || exit 1
$BOAR mksession --repo=$REPO_PATH RäksmörgåsSession || exit 1
$BOAR co RäksmörgåsSession || exit 1

echo "Rev 2" >RäksmörgåsSession/r2.txt || exit 1
echo "Rev 2" >RäksmörgåsSession/modified.txt || exit 1
(cd RäksmörgåsSession && $BOAR ci -q) || exit 1

rm RäksmörgåsSession/r2.txt || exit 1
echo "Rev 3" >RäksmörgåsSession/r3.txt || exit 1
echo "Rev 3" >RäksmörgåsSession/modified.txt || exit 1
cp /bin/ls RäksmörgåsSession/räksmörgås.bin || exit 1
(cd RäksmörgåsSession && md5sum räksmörgås.bin >manifest-md5.txt) || exit 1
(cd RäksmörgåsSession && $BOAR ci -q) || exit 1

($BOAR cat RäksmörgåsSession/r3.txt | grep "Rev 3") || { echo "Unexpected output for cat r3.txt"; exit 1; }
$BOAR cat RäksmörgåsSession/r2.txt && { echo "Missing file should fail"; exit 1; }
$BOAR cat -r2 RäksmörgåsSession/r2.txt | grep "Rev 2" || { echo "Unexpected output for cat -r2 r2.txt"; exit 1; }
$BOAR cat RäksmörgåsSession/räksmörgås.bin >räksmörgås.bin || { echo "Binary file cat failed"; exit 1; }
md5sum -c RäksmörgåsSession/manifest-md5.txt || exit 1

echo "All is well"
true<commit_msg>Testing cat of multiple blobs<commit_after># Test that the cat command behaves as expected.

export REPO_PATH=`pwd`/TESTREPO
$BOAR mkrepo $REPO_PATH || exit 1
$BOAR mksession --repo=$REPO_PATH RäksmörgåsSession || exit 1
$BOAR co RäksmörgåsSession || exit 1

echo "Rev 2" >RäksmörgåsSession/r2.txt || exit 1
echo "Modified rev 2" >RäksmörgåsSession/modified.txt || exit 1
(cd RäksmörgåsSession && $BOAR ci -q) || exit 1

rm RäksmörgåsSession/r2.txt || exit 1
echo "Rev 3" >RäksmörgåsSession/r3.txt || exit 1
echo "Modified rev 3" >RäksmörgåsSession/modified.txt || exit 1
cp /bin/ls RäksmörgåsSession/räksmörgås.bin || exit 1
(cd RäksmörgåsSession && md5sum räksmörgås.bin >manifest-md5.txt) || exit 1
(cd RäksmörgåsSession && $BOAR ci -q) || exit 1

($BOAR cat RäksmörgåsSession/r3.txt | grep "Rev 3") || { echo "Unexpected output for cat r3.txt"; exit 1; }
$BOAR cat RäksmörgåsSession/r2.txt && { echo "Missing file should fail"; exit 1; }
$BOAR cat -r2 RäksmörgåsSession/r2.txt | grep "Rev 2" || { echo "Unexpected output for cat -r2 r2.txt"; exit 1; }
$BOAR cat RäksmörgåsSession/räksmörgås.bin >räksmörgås.bin || { echo "Binary file cat failed"; exit 1; }
md5sum -c RäksmörgåsSession/manifest-md5.txt || exit 1

cat >expected.txt <<EOF
Rev 3
Modified rev 3
EOF

$BOAR cat RäksmörgåsSession/r3.txt RäksmörgåsSession/modified.txt >output.txt || { 
    cat output.txt; echo "Couldn't cat multiple files"; exit 1; }
txtmatch.py expected.txt output.txt || { echo "Cat multiple files gave unexpected output"; exit 1; }


echo "All is well"
true
{'fraction_non_alphanumeric': 0.1233175700254638, 'fraction_numerical': 0.028737722808293925, 'mean_word_length': 4.522088353413655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '317820', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1152, 'n_words': 324}