#pragma once
#ifndef WREN_TEST_H
#define WREN_TEST_H
#include <stdio.h>
#include <string.h>
#include "wren.h"
#define WREN_EX_USAGE 64
#define WREN_EX_DATAERR 65
#define WREN_EX_SOFTWARE 70
#define WREN_EX_NOINPUT 66
#define WREN_EX_IOERR 74
#define MAX_COMPONENTS 2048
typedef struct {
const char* start;
const char* end;
} Slice;
typedef enum
{
PATH_TYPE_ABSOLUTE,
PATH_TYPE_RELATIVE,
PATH_TYPE_SIMPLE,
} PathType;
typedef struct
{
char* chars;
size_t length;
size_t capacity;
} Path;
void ensureCapacity(Path* path, size_t capacity);
void appendSlice(Path* path, Slice slice);
void pathAppendString(Path* path, const char* string);
void pathFree(Path* path);
void pathDirName(Path* path);
void pathRemoveExtension(Path* path);
void pathAppendChar(Path* path, char c);
void pathJoin(Path* path, const char* string);
void pathNormalize(Path* path);
char* pathToString(Path* path);
PathType pathType(const char* path);
char* readFile(const char* path);
WrenLoadModuleResult readModule(WrenVM* vm, const char* module);
void vm_write(WrenVM* vm, const char* text);
void reportError(WrenVM* vm, WrenErrorType type, const char* module, int line, const char* message);
const char* resolveModule(WrenVM* vm, const char* importer, const char* module);
bool isModuleAnAPITest(const char* module);
WrenInterpretResult runFile(WrenVM* vm, const char* path);
int handle_args(int argc, const char* argv[]);
#endif