// Kyler Olsen
// YREA SLS
// Tests Header
// October 2025

#ifndef SLS_TESTS_H
#define SLS_TESTS_H

#include <stddef.h>

#include "sls/errors.h"
#include "sls/string.h"

extern const SlsStr TEST_FILE_NAME;

typedef enum {
    TEST_ERROR, // The test encountered an error
    TEST_LOGIC_FAIL, // The lexer encountered an error
    TEST_LOGIC_ERROR_FAIL, // The test failed because of a lexical error reported from the parsed code
    TEST_ERROR_FAIL, // The test failed
    TEST_PASS, // The test passed
    TEST_NOT_IMPLEMENTED, // The test is not implemented
} TestResultType;

typedef struct {
    SlsStr name;
    TestResultType status;
    union {
        SlsStr message; // status in { TEST_LOGIC_FAIL, }
        SlsError error; // status in { TEST_ERROR, TEST_ERROR_FAIL, }
    };
} TestResult;

typedef struct {
    SlsStr section;
    size_t count;
    TestResult* tests;
} TestsReport;

TestsReport run_string_tests();
TestsReport run_lexer_tests();
TestsReport run_hash_table_tests();
TestsReport run_extra_tests();

#endif // SLS_TESTS_H
