<commit_before>#include "minunit.h"
#include <minipack.h>

#include "memdump.h"

//==============================================================================
//
// Test Cases
//
//==============================================================================

int test_float_read() {
    mu_assert(minipack_float_read("\xCA\x00\x00\x00\x00") == 0);
    mu_assert(minipack_float_read("\xCA\x42\xC8\x00\x00") == 100);
    mu_assert(minipack_float_read("\xCA\xC2\xC8\x00\x00") == -100);
    float value = minipack_float_read("\xCA\x42\xC8\x66\x66");      // = 100.2
    mu_assert_mem(&value, 4, "\x66\x66\xC8\x42");
    return 0;
}

int test_float_write() {<commit_msg>Add msgpack validation for floats.<commit_after>#include <minipack.h>
#include <msgpack.h>

#include "minunit.h"
#include "memdump.h"

//==============================================================================
//
// Test Cases
//
//==============================================================================

int test_float_read() {
    mu_assert(minipack_float_read("\xCA\x00\x00\x00\x00") == 0);
    mu_assert_msgpack_float(0, 5, "\xCA\x00\x00\x00\x00");
    mu_assert(minipack_float_read("\xCA\x42\xC8\x00\x00") == 100);
    mu_assert_msgpack_float(100, 5, "\xCA\x42\xC8\x00\x00");
    mu_assert(minipack_float_read("\xCA\xC2\xC8\x00\x00") == -100);
    mu_assert_msgpack_float(-100, 5, "\xCA\xC2\xC8\x00\x00");
    float value = minipack_float_read("\xCA\x42\xC8\x66\x66");      // = 100.2
    mu_assert_mem(&value, 4, "\x66\x66\xC8\x42");
    mu_assert_msgpack_float(100.2, 5, "\xCA\x42\xC8\x66\x66");
    return 0;
}

int test_float_write() {
{'fraction_non_alphanumeric': 0.3521819299323909, 'fraction_numerical': 0.08543331284572833, 'mean_word_length': 4.672473867595818, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '192090', 'n_tokens_mistral': 706, 'n_tokens_neox': 612, 'n_words': 72}