<commit_before>#include <map>
#include "Tests.h"


void veroRestApiTest() {
    // rest authenticate
    bool ret = restAuthenticate(KServerAddr, KPort, KUserName, KPassword);
    if (!ret) {
        report();
    }

    // rest projects
	std::map<string, string> projectMap;
	restListProjects(KServerAddr, KPort, KUserName, KPassword, projectMap);

	for (std::map<string, string>::iterator i = projectMap.begin(); i != projectMap.end(); i++) {
		cout << "Project = " << (*i).first << endl;
	}

    // rest meta
    std::unique_ptr<MetadataResponse> metaResponse = restGetMeta(KServerAddr, KPort, KUserName, KPassword, KDefaultProject);
}


void veroMakeUriTest() {
	char project[100];

	strcpy(project, "yulins_project");
	makeSlug(project);
	
	cout << "\n";
	cout << "Project make slug = " << project << "\n";

	std::wstringstream metaUri = makeMetaUri(project);
	std::wstringstream queryUri = makeQueryUri(project);

	std::unique_ptr<char[]> metaUriPtr = wchar2char(metaUri.str().c_str());
	std::unique_ptr<char[]> queryUriPtr = wchar2char(queryUri.str().c_str());

	cout << "Meta uri = " << metaUriPtr.get() << "\n";
	cout << "Query uri = " << queryUriPtr.get() << "\n";
}
<commit_msg>Test rest query.<commit_after>#include <map>
#include "Tests.h"


void veroRestApiTest() {
    // rest authenticate
    bool ret = restAuthenticate(KServerAddr, KPort, KUserName, KPassword);
    if (!ret) {
        report();
    }

    // rest projects
	std::map<string, string> projectMap;
	restListProjects(KServerAddr, KPort, KUserName, KPassword, projectMap);

	for (std::map<string, string>::iterator i = projectMap.begin(); i != projectMap.end(); i++) {
		cout << "Project = " << (*i).first << endl;
	}

    // rest meta
    std::unique_ptr<MetadataResponse> metaResponse = restGetMeta(KServerAddr, KPort, KUserName, KPassword, KDefaultProject);

	// rest query
	{
		std::unique_ptr<SQLResponse> y = restQuery(L"select Year", KServerAddr, KPort,
			KUserName, KPassword, KDefaultProject);

		if ((int)y->results.size() != 1) {
			report();
		}
	}
}


void veroMakeUriTest() {
	char project[100];

	strcpy(project, "yulins_project");
	makeSlug(project);
	
	cout << "\n";
	cout << "Project make slug = " << project << "\n";

	std::wstringstream metaUri = makeMetaUri(project);
	std::wstringstream queryUri = makeQueryUri(project);

	std::unique_ptr<char[]> metaUriPtr = wchar2char(metaUri.str().c_str());
	std::unique_ptr<char[]> queryUriPtr = wchar2char(queryUri.str().c_str());

	cout << "Meta uri = " << metaUriPtr.get() << "\n";
	cout << "Query uri = " << queryUriPtr.get() << "\n";
}

{'fraction_non_alphanumeric': 0.1758326878388846, 'fraction_numerical': 0.004260263361735089, 'mean_word_length': 4.507462686567164, 'pattern_counts': {'":': 0, '<': 68, '<?xml version=': 0, '>': 17, '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': '1263151', 'n_tokens_mistral': 928, 'n_tokens_neox': 885, 'n_words': 187}