46extern bool ScriptAdminMakeJSON(nlohmann::json &json, HSQUIRRELVM vm, SQInteger index,
int depth = 0);
54 auto vm = sq_open(1024);
57 std::string buffer = fmt::format(
"return {}", squirrel);
61 sq_pushstring(vm,
"DummyClass");
62 sq_newclass(vm, SQFalse);
63 sq_newslot(vm, -3, SQFalse);
67 REQUIRE(sq_compilebuffer(vm, buffer,
"test", SQTrue) == SQ_OK);
70 REQUIRE(sq_call(vm, 1, SQTrue, SQTrue) == SQ_OK);
72 REQUIRE(sq_gettype(vm, -1) == OT_TABLE);
76 if (!ScriptAdminMakeJSON(json, vm, -1)) {
104 auto vm = sq_open(1024);
107 ScriptEventAdminPort(json).GetObject(vm);
108 if (sq_gettype(vm, -1) == OT_NULL) {
112 REQUIRE(sq_gettype(vm, -1) == OT_TABLE);
114 nlohmann::json squirrel_json;
115 REQUIRE(ScriptAdminMakeJSON(squirrel_json, vm, -1) ==
true);
118 return squirrel_json.dump();