<commit_before>#include "../greatest.h"
#include "../../pstring.h"
#include <stdlib.h>
#include <string.h>

TEST test_pact_string_assign_simple() {
	char* str = "This is some test data.";
	pact_String* pstring = pact_string_create(NULL);
	ASSERTm("pact_string_assign returned non-zero", pact_string_assign(pstring, str) == 0);
	ASSERT_STR_EQm("pact_string_view returned different data", str, pact_string_view(pstring));
	pact_string_destroy(pstring);
	PASS();
}

TEST test_pact_string_assign_nulls() {
	char* str = "This \0is \0some \0test \0data \0with \0nulls.";
	char* check = "This ";<commit_msg>Updated string unit tests.  Added create check.<commit_after>#include "../greatest.h"
#include "../../pstring.h"
#include <stdlib.h>
#include <string.h>

TEST test_pact_string_create() {
	pact_String* pstring = pact_string_create("Hello World");
	ASSERTm("pact_string_create, null returned", pstring != NULL);
	ASSERT_STR_EQm("pact_string_create non null argument returns different data", "Hello World", pact_string_view(pstring));
	pact_string_destroy(pstring);
	PASS();
}

TEST test_pact_string_assign_simple() {
	char* str = "This is some test data.";
	pact_String* pstring = pact_string_create(NULL);
	ASSERTm("pact_string_assign returned non-zero", pact_string_assign(pstring, str) == 0);
	ASSERT_STR_EQm("pact_string_view returned different data", str, pact_string_view(pstring));
	pact_string_destroy(pstring);
	PASS();
}

TEST test_pact_string_assign_nulls() {
	char* str = "This \0is \0some \0test \0data \0with \0nulls.";
	char* check = "This ";
{'fraction_non_alphanumeric': 0.14083601286173633, 'fraction_numerical': 0.0090032154340836, 'mean_word_length': 6.105022831050229, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6061375', 'n_tokens_mistral': 565, 'n_tokens_neox': 551, 'n_words': 125}