1
0
forked from Mirror/wren
Files
wren/test/api/value.c
Bob Nystrom 7a79b8fac6 Simplify the API tests.
Use fewer test suites with more tests in each one since there's so much
boilerplate for defining an API test.
2015-08-13 09:09:27 -07:00

25 lines
461 B
C

#include <string.h>
#include "value.h"
static WrenValue* value;
static void setValue(WrenVM* vm)
{
value = wrenGetArgumentValue(vm, 1);
}
static void getValue(WrenVM* vm)
{
wrenReturnValue(vm, value);
wrenReleaseValue(vm, value);
}
WrenForeignMethodFn valueBindForeign(const char* signature)
{
if (strcmp(signature, "static Api.value=(_)") == 0) return setValue;
if (strcmp(signature, "static Api.value") == 0) return getValue;
return NULL;
}