<commit_before>#include <iostream>
#include <fstream>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#ifdef _WIN32
#include <windows.h>
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
#endif


#include "parser/parser.hpp"
#include "serializer/serializer.hpp"
#include "serializerHtml/serializerHtml.hpp"

using namespace std;
using namespace webss;

enum class ErrorType { NONE, FATAL, PARSE, SERIALIZE, PARSE_AFTER_SERIALIZATION, EQUALITY, TEST };

string makeCompleteFilenameIn(string filename);
string makeCompleteFilenameOut(string filename);
ErrorType test(string filename, function<void(const Document& doc)> checkResult);
void testDictionary();
void testTemplateStd();
ErrorType testSerializerHtml();
template <class Element>
bool hasKeys(const Element& elem, set<string> keys);

char inChar;

int main()
{
	do
	{
		vector<string> filenames
		{
			"strings", "namespace", "enum", "names-keywords", "multiline-string-options", "assignAbstractEntity",
			"expandTuple", "templatePlus", "list", "tuple", "option", "expandThead",
		};
		for (const auto& filename : filenames)
		{
			test(filename, [](const Document&) {});
			cout << endl;
		}

		testDictionary();
		cout << endl;
		testTemplateStd();
		cout << endl;
		testSerializerHtml();
		cin >> inChar;
	} while (inChar != 'q');

    return 0;
}

string makeCompleteFilenameIn(string filename)
{
	return "files-in/" + filename + ".wbsn";
}
string makeCompleteFilenameOut(string filename)
{
	return filename + ".wbsnout";
}

void softAssert(bool condition, unsigned int line)
{
	if (condition)
		return;
	throw logic_error(string("[ln ") + to_string(line) + "] assert failed");
}

void softAssertBool(const Webss& value, bool b, unsigned int line)
{
	softAssert(value.isBool() && value.getBool() == b, line);
}

void softAssertInt(const Webss& value, WebssInt i, unsigned int line)
{<commit_msg>Remove loop in tests<commit_after>#include <iostream>
#include <fstream>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#ifdef _WIN32
#include <windows.h>
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
#endif


#include "parser/parser.hpp"
#include "serializer/serializer.hpp"
#include "serializerHtml/serializerHtml.hpp"

using namespace std;
using namespace webss;

enum class ErrorType { NONE, FATAL, PARSE, SERIALIZE, PARSE_AFTER_SERIALIZATION, EQUALITY, TEST };

string makeCompleteFilenameIn(string filename);
string makeCompleteFilenameOut(string filename);
ErrorType test(string filename, function<void(const Document& doc)> checkResult);
void testDictionary();
void testTemplateStd();
ErrorType testSerializerHtml();
template <class Element>
bool hasKeys(const Element& elem, set<string> keys);

int main()
{
	vector<string> filenames
	{
		"strings", "namespace", "enum", "names-keywords", "multiline-string-options", "assignAbstractEntity",
		"expandTuple", "templatePlus", "list", "tuple", "option", "expandThead",
	};
	for (const auto& filename : filenames)
	{
		test(filename, [](const Document&) {});
		cout << endl;
	}

	testDictionary();
	cout << endl;
	testTemplateStd();
	cout << endl;
	testSerializerHtml();

    return 0;
}

string makeCompleteFilenameIn(string filename)
{
	return "files-in/" + filename + ".wbsn";
}
string makeCompleteFilenameOut(string filename)
{
	return filename + ".wbsnout";
}

void softAssert(bool condition, unsigned int line)
{
	if (condition)
		return;
	throw logic_error(string("[ln ") + to_string(line) + "] assert failed");
}

void softAssertBool(const Webss& value, bool b, unsigned int line)
{
	softAssert(value.isBool() && value.getBool() == b, line);
}

void softAssertInt(const Webss& value, WebssInt i, unsigned int line)
{
{'fraction_non_alphanumeric': 0.13754747693977212, 'fraction_numerical': 0.0016277807921866521, 'mean_word_length': 6.049713193116634, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 27, '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': '2306481', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1177, 'n_words': 319}