<commit_before>#include <vector>

#include "gtest/gtest.h"
#include "amf.hpp"
#include "types/amfitem.hpp"

using namespace amf;

static inline void isEqual(const std::vector<u8>& expected, const v8& serialized) {
	ASSERT_EQ(expected, serialized) << "Expected length " << expected.size()
	                                << ", got " << serialized.size();
}

static inline void isEqual(const std::vector<u8>& expected, const AmfItem& value) {
	v8 serialized = value.serialize();
	isEqual(expected, serialized);
}

template<typename T, typename V>
void deserializesTo(V expected, const v8& data, int expectedLeft = 0) {
	auto it = data.begin();
	T i = T::deserialize(it, data.end());
	ASSERT_EQ(expectedLeft, data.end() - it)
		<< "Expected " << expectedLeft
	  << " bytes left, got " << (data.end() - it)
	  << " bytes left";
	ASSERT_EQ(expected, i.value) << "Expected value " << ::testing::PrintToString(expected)
	                             << ", got " << ::testing::PrintToString(i.value);
}<commit_msg>Formatting.<commit_after>#include <vector>

#include "gtest/gtest.h"
#include "amf.hpp"
#include "types/amfitem.hpp"

using namespace amf;

static inline void isEqual(const std::vector<u8>& expected, const v8& serialized) {
	ASSERT_EQ(expected, serialized)
		<< "Expected length " << expected.size()
		<< ", got " << serialized.size();
}

static inline void isEqual(const std::vector<u8>& expected, const AmfItem& value) {
	v8 serialized = value.serialize();
	isEqual(expected, serialized);
}

template<typename T, typename V>
void deserializesTo(V expected, const v8& data, int expectedLeft = 0) {
	auto it = data.begin();
	T i = T::deserialize(it, data.end());
	ASSERT_EQ(expectedLeft, data.end() - it)
		<< "Expected " << expectedLeft
		<< " bytes left, got " << (data.end() - it)
		<< " bytes left";
	ASSERT_EQ(expected, i.value)
		<< "Expected value " << ::testing::PrintToString(expected)
		<< ", got " << ::testing::PrintToString(i.value);
}
{'fraction_non_alphanumeric': 0.1672634271099744, 'fraction_numerical': 0.006138107416879796, 'mean_word_length': 4.272237196765499, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '720262', 'n_tokens_mistral': 647, 'n_tokens_neox': 630, 'n_words': 160}