<commit_before>#ifndef _edna_unit_
#define _edna_unit_

#include <setjmp.h>
#include <stdbool.h>
#include <stdio.h>
#include <signal.h>

#define unit_catch() sigsetjmp(unit_checkpoint, 1)

#define unit_error_fmt(...) do {         \
	char buf[256];                   \
	snprintf(buf, 256, __VA_ARGS__); \
	unit_error(buf);                 \
} while (0)

#define unit_fail_fmt(...) do {          \
	char buf[256];                   \
	snprintf(buf, 256, __VA_ARGS__); \
	unit_fail(buf);                  \
} while (0)

#define unit_list(...) ((void (*[])()){__VA_ARGS__, 0x0})

#define try(EXPR) do {                 \
	unit_set_expr(#EXPR,__LINE__); \
	EXPR;                          \
	unit_unset_expr();             \
} while (0)

#define ok(EXPR) okf(EXPR, "assertion false: \"%s\" " \
                     "(line %d)", #EXPR, __LINE__); 

#define okf(EXPR, ...) do {              \
	char msg[256];                   \
	snprintf(msg, 256, __VA_ARGS__); \
	_unit_ok(EXPR, msg);             \
} while (0)<commit_msg>Tweak okf() a little.<commit_after>#ifndef _edna_unit_
#define _edna_unit_

#include <setjmp.h>
#include <stdbool.h>
#include <stdio.h>
#include <signal.h>

#define unit_catch() sigsetjmp(unit_checkpoint, 1)

#define unit_error_fmt(...) do {         \
	char buf[256];                   \
	snprintf(buf, 256, __VA_ARGS__); \
	unit_error(buf);                 \
} while (0)

#define unit_fail_fmt(...) do {          \
	char buf[256];                   \
	snprintf(buf, 256, __VA_ARGS__); \
	unit_fail(buf);                  \
} while (0)

#define unit_list(...) ((void (*[])()){__VA_ARGS__, 0x0})

#define try(EXPR) do {                 \
	unit_set_expr(#EXPR,__LINE__); \
	EXPR;                          \
	unit_unset_expr();             \
} while (0)

#define ok(EXPR) okf(EXPR, "assertion false: \"%s\" ", #EXPR); 

#define okm(EXPR, MSG) okf(EXPR, MSG "%s", "")
#define okf(EXPR, FMT, ...) do {	  \
	char *unit_msg = asprintf(FMT " (line %d)", \
	                          __VA_ARGS__, __LINE__); \
	_unit_ok(EXPR, unit_msg);          \
} while (0)
{'fraction_non_alphanumeric': 0.16940948693126814, 'fraction_numerical': 0.021297192642787996, 'mean_word_length': 1.9486447931526392, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '25173', 'n_tokens_mistral': 815, 'n_tokens_neox': 777, 'n_words': 154}