lexlib 2.0.1

library with miscellaneous stuff
Documentation
// Copyright 2023 alexevier <alexevier@proton.me>
// licensed under the zlib license <https://www.zlib.net/zlib_license.html>

#include<lexlib/str.h>
#include<stdlib.h>
#include<string.h>
#include"test.h"

void testStrPath(void){
	testStart("strPath");
	unsigned char err = 0;
#ifdef _WIN32
	char patht[] = "yes\\ i exist\\path\\sub\\dir\\directowy\\protected\\important thing.txt";
#else
	char patht[] = "yes/ i exist/path/sub/dir/directowy/protected/important thing.txt";
#endif
	char* path = lexlibStrPathNew("yes/ i exist");
	lexlibStrPathPush(&path, "path");
	lexlibStrPathPush(&path, "sub/");
	lexlibStrPathPush(&path, "/dir");
	lexlibStrPathPush(&path, "/directowy/");
	lexlibStrPathPush(&path, "protected");
	lexlibStrPathAsDir(&path);
	lexlibStrPathPush(&path, "important thing.txt/");
	lexlibStrPathAsFile(&path);

	if(strcmp(path, patht))
		err = 1;

	free(path);
	if(err)
		testEnd("error");
	else
		testEnd(NULL);
}