mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
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.
30 lines
349 B
C
30 lines
349 B
C
#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;
|
|
}
|
|
|