<commit_before>#include <cstdio>
#include <string>
#include "catch.hh"
#include "lib/File.h"
#include "test_crc_support.h"

namespace
{
    std::string getTestContent()
    {
        std::string result = "";
        for (size_t i = 0; i < 11411; i ++)
            result += std::to_string(static_cast<char>(i & 0xFF));
        return result;
    }
}

void test_computing(const CRC &crc, CRC::Value checksum)
{
    Progress progress;
    std::string content = "123456789";

    auto inFile = File::fromFileName(
        "test-in.txt",
        File::Mode::Write | File::Mode::Read | File::Mode::Binary);

    inFile->write(content.data(), content.size());
    inFile->seek(0, File::Origin::Start);
    REQUIRE(crc.computeChecksum(*inFile, progress) == checksum);

    std::remove("test-in.txt");
}
<commit_msg>Fixed tests depending on each other<commit_after>#include <cstdio>
#include <string>
#include "catch.hh"
#include "lib/File.h"
#include "test_crc_support.h"

namespace
{
    std::string getTestContent()
    {
        std::string result = "";
        for (size_t i = 0; i < 11411; i ++)
            result += std::to_string(static_cast<char>(i & 0xFF));
        return result;
    }
}

void test_computing(const CRC &crc, CRC::Value checksum)
{
    Progress progress;
    std::string content = "123456789";

    {
        auto f = File::fromFileName(
            "test.txt", File::Mode::Write | File::Mode::Binary);
        f->write(content.data(), content.size());
    }

    {
        auto f = File::fromFileName(
            "test.txt", File::Mode::Read | File::Mode::Binary);
        REQUIRE(crc.computeChecksum(*f, progress) == checksum);
    }

    std::remove("test-in.txt");
}

{'fraction_non_alphanumeric': 0.16725768321513002, 'fraction_numerical': 0.01950354609929078, 'mean_word_length': 3.0795180722891566, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '4007499', 'n_tokens_mistral': 597, 'n_tokens_neox': 562, 'n_words': 114}