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

#include "util.h"
#include "path.h"
#include "alloc.h"

#define DIE() ice(__FILE__, __LINE__, __func__, NULL)

void ice(const char *f, int line, const char *fn, const char *fmt, ...)
{
	(void)fmt;
	fprintf(stderr, "ice: %s:%d: %s\n", f, line, fn);
	exit(1);
}

int main()
{
	if(strcmp(
			canonicalise_path(ustrdup("./hello///there//..//tim/./file.")),
			"hello/tim/file."))
	{
		DIE();
	}

	if(strcmp(
			canonicalise_path(ustrdup("./hello///there//..//tim/./file../.dir/")),
			"hello/tim/file../.dir/"))
	{
		DIE();
	}

	if(strcmp(canonicalise_path(ustrdup("../")), "../"))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("..")), ".."))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("./..")), ".."))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("../..")), "../.."))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("./../../")), "../../"))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("../../hi")), "../../hi"))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("hi/../../")), "../"))
		DIE();

	char *got = canonicalise_path(ustrdup("../../hi/../..//../"));
	if(strcmp(got, "../../../../")){
		fprintf(stderr, "got='%s'\n", got);
		DIE();
	}

	return 0;
}
<commit_msg>Change test.c's ICE message<commit_after>#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>

#include "util.h"
#include "path.h"
#include "alloc.h"

#define DIE() ice(__FILE__, __LINE__, __func__, NULL)

void ice(const char *f, int line, const char *fn, const char *fmt, ...)
{
	(void)fmt;
	fprintf(stderr, "%s:%d: ice: %s\n", f, line, fn);
	exit(1);
}

int main()
{
	if(strcmp(
			canonicalise_path(ustrdup("./hello///there//..//tim/./file.")),
			"hello/tim/file."))
	{
		DIE();
	}

	if(strcmp(
			canonicalise_path(ustrdup("./hello///there//..//tim/./file../.dir/")),
			"hello/tim/file../.dir/"))
	{
		DIE();
	}

	if(strcmp(canonicalise_path(ustrdup("../")), "../"))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("..")), ".."))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("./..")), ".."))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("../..")), "../.."))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("./../../")), "../../"))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("../../hi")), "../../hi"))
		DIE();

	if(strcmp(canonicalise_path(ustrdup("hi/../../")), "../"))
		DIE();

	char *got = canonicalise_path(ustrdup("../../hi/../..//../"));
	if(strcmp(got, "../../../../")){
		fprintf(stderr, "got='%s'\n", got);
		DIE();
	}

	return 0;
}

{'fraction_non_alphanumeric': 0.3116169544740973, 'fraction_numerical': 0.0015698587127158557, 'mean_word_length': 3.091492776886035, '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': '179990', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1045, 'n_words': 155}