<commit_before>"""
TESTS is a dict with all you tests.
Keys for this will be categories' names.
Each test is dict with
    "input" -- input data for user function
    "answer" -- your right answer
    "explanation" -- not necessary key, it's using for additional info in animation.
"""

import hashlib
import random
from sys import version_info as version

hashfunc_dic = {"md5":hashlib.md5, "sha225": hashlib.sha224, "sha256":hashlib.sha256, "sha256":hashlib.sha256,
            "sha384":hashlib.sha384, "sha512":hashlib.sha512, "sha1":hashlib.sha1
            }


if version.major == 3: 
    hash_text = lambda t, func: hashfunc_dic[func](bytes(t, "utf-8")).hexdigest()
else:
    hash_text = lambda t, func: hashfunc_dic[func](t).hexdigest()

result_list = []
for hash_f in hashfunc_dic:
    for i in range(40):
        t=""
        for j in range(1, random.randint(1,100)):
            t+=chr(random.randint(32,126))
        result_list.append({"input": (t, hash_f), "answer": hash_text(t, hash_f)})

TESTS = {
    "Basics": [<commit_msg>fix test cases<commit_after>"""
TESTS is a dict with all you tests.
Keys for this will be categories' names.
Each test is dict with
    "input" -- input data for user function
    "answer" -- your right answer
    "explanation" -- not necessary key, it's using for additional info in animation.
"""

import hashlib
import random
from sys import version_info as version

hashfunc_dic = {"md5":hashlib.md5, "sha224": hashlib.sha224, "sha256":hashlib.sha256, "sha256":hashlib.sha256,
            "sha384":hashlib.sha384, "sha512":hashlib.sha512, "sha1":hashlib.sha1
            }


if version.major == 3:
    hash_text = lambda t, func: hashfunc_dic[func](bytes(t, "utf-8")).hexdigest()
else:
    hash_text = lambda t, func: hashfunc_dic[func](t).hexdigest()

result_list = []
for hash_f in hashfunc_dic:
    for i in range(40):
        t=""
        for j in range(1, random.randint(1,100)):
            t+=chr(random.randint(32,126))
        result_list.append({"input": (t, hash_f), "answer": hash_text(t, hash_f)})

TESTS = {
    "Basics": [
{'fraction_non_alphanumeric': 0.13928914505283382, 'fraction_numerical': 0.04610951008645533, 'mean_word_length': 3.4892241379310347, 'pattern_counts': {'":': 20, '<': 3, '<?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': '1319772', 'n_tokens_mistral': 778, 'n_tokens_neox': 709, 'n_words': 202}