Add a minimal path manipulation C module.
This is just for the VM's own internal use, for resolving relative imports. Also added a tiny unit test framework for writing tests of low-level C functionality that isn't exposed directly by the language or VM.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "test.h"
|
||||
|
||||
int passes = 0;
|
||||
int failures = 0;
|
||||
|
||||
void pass()
|
||||
{
|
||||
passes++;
|
||||
}
|
||||
|
||||
void fail()
|
||||
{
|
||||
failures++;
|
||||
}
|
||||
|
||||
int showTestResults()
|
||||
{
|
||||
if (failures > 0)
|
||||
{
|
||||
printf("%d out of %d tests failed. :(\n", failures, passes + failures);
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("All %d tests passed!\n", passes + failures);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user