forked from Mirror/wren
This commit is contained in:
@ -23,12 +23,16 @@ static void multipleInterpretCalls(WrenVM* vm)
|
||||
// Handles should be valid across calls into Wren code.
|
||||
WrenHandle* absMethod = wrenMakeCallHandle(otherVM, "abs");
|
||||
|
||||
result = wrenInterpret(otherVM, "main", "import \"random\" for Random");
|
||||
correct = correct && (result == WREN_RESULT_SUCCESS);
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
// Calling `wrenEnsureSlots()` before `wrenInterpret()` should not introduce
|
||||
// problems later.
|
||||
wrenEnsureSlots(otherVM, 2);
|
||||
|
||||
result = wrenInterpret(otherVM, "main", "1 + 2");
|
||||
// Calling a foreign function should succeed.
|
||||
result = wrenInterpret(otherVM, "main", "Random.new(12345)");
|
||||
correct = correct && (result == WREN_RESULT_SUCCESS);
|
||||
|
||||
wrenEnsureSlots(otherVM, 2);
|
||||
|
||||
Reference in New Issue
Block a user