<commit_before>#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdbool.h>

#include "flibs/fhash.h"
#include "flibs/flist.h"

#include "api/sk_utils.h"
#include "api/sk_env.h"
#include "api/sk_module.h"
#include "api/sk_workflow.h"
#include "api/sk_entity.h"
#include "api/sk_txn.h"
#include "api/sk_service.h"
#include "api/sk_loader.h"

#include "skull/metrics_utils.h"
#include "skull/ep.h"
#include "txn_utils.h"
#include "srv_types.h"

#include "skull/unittest.h"

struct skullut_module_t {
    sk_module_t*    module;
    fhash*          services; // key: name; value: mock_service

    sk_workflow_t*  workflow;
    sk_entity_t*    entity;
    sk_txn_t*       txn;
    flist*          tasks;    // hold mock_tasks

    sk_workflow_cfg_t* workflow_cfg;
    sk_module_cfg_t    module_cfg;
};

skullut_module_t* skullut_module_create(const char* module_name,
                                  const char* idl_name,
                                  const char* conf_name,
                                  const char* type,
                                  skull_module_loader_t loader)
{
    skull_module_register_loader(type, loader);
<commit_msg>refine unittest.c<commit_after>#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdbool.h>

#include "flibs/fhash.h"
#include "flibs/flist.h"

#include "api/sk_utils.h"
#include "api/sk_env.h"
#include "api/sk_module.h"
#include "api/sk_workflow.h"
#include "api/sk_entity.h"
#include "api/sk_txn.h"
#include "api/sk_service.h"
#include "api/sk_loader.h"

#include "skull/metrics_utils.h"
#include "skull/ep.h"
#include "txn_utils.h"
#include "srv_types.h"

#include "skull/unittest.h"

struct skullut_module_t {
    sk_module_t*    module;
    fhash*          services; // key: name; value: mock_service

    sk_workflow_t*  workflow;
    sk_entity_t*    entity;
    sk_txn_t*       txn;
    flist*          tasks;    // hold mock_tasks

    sk_workflow_cfg_t* workflow_cfg;
    sk_module_cfg_t    module_cfg;
};

skullut_module_t* skullut_module_create(const char* module_name,
                                        const char* idl_name,
                                        const char* conf_name,
                                        const char* type,
                                        skull_module_loader_t loader)
{
    skull_module_register_loader(type, loader);

{'fraction_non_alphanumeric': 0.11218487394957984, 'fraction_numerical': 0.0, 'mean_word_length': 2.3965763195435095, 'pattern_counts': {'":': 0, '<': 11, '<?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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '782734', 'n_tokens_mistral': 872, 'n_tokens_neox': 862, 'n_words': 159}