<commit_before>#include <stdarg.h>
#include <stddef.h>
#include <stdbool.h>
#include <setjmp.h>
#include <cmockery.h>
#include <stdio.h>
#include <string.h>
#include "compile.h"

//
// Possible scenarios:
// *    string empty
//      string not empty
// *    contains group
//      contains fixed
//      contains wildcard
//      contains kleene
// *    contains "**"
//


static void
test_empty(state)
    void ** state;
{
    Wildcard *    wildcard;
    const char *  cstring;

    cstring  = "";
    wildcard = Wildcard_compile(cstring, strlen(cstring));
    assert_int_not_equal( (int)NULL, (int)wildcard        );
    assert_int_equal(     (int)NULL, (int)wildcard->first );
    assert_int_equal(     (int)NULL, (int)wildcard->last  );
    assert_int_equal(     0,         wildcard->length     );
}

<commit_msg>fixed mem leak in first test<commit_after>#include <stdarg.h>
#include <stddef.h>
#include <stdbool.h>
#include <setjmp.h>
#include <cmockery.h>
#include <stdio.h>
#include <string.h>
#include "compile.h"
#include "Wildcard.h"

//
// Possible scenarios:
// *    string empty
//      string not empty
// *    contains group
//      contains fixed
//      contains wildcard
//      contains kleene
// *    contains "**"
//


static void
test_empty(state)
    void ** state;
{
    Wildcard *    wildcard;
    const char *  cstring;

    cstring  = "";
    wildcard = Wildcard_compile(cstring, strlen(cstring));
    assert_int_not_equal( (int)NULL, (int)wildcard        );
    assert_int_equal(     (int)NULL, (int)wildcard->first );
    assert_int_equal(     (int)NULL, (int)wildcard->last  );
    assert_int_equal(     0,         wildcard->length     );

    Wildcard_free(wildcard);
}


{'fraction_non_alphanumeric': 0.14386376981796828, 'fraction_numerical': 0.0011743981209630064, 'mean_word_length': 2.712418300653595, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, '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': '2320283', 'n_tokens_mistral': 608, 'n_tokens_neox': 591, 'n_words': 124}