meta: re-organise tests
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include <fx/core/stream.h>
|
||||
#include <fx/ds/array.h>
|
||||
#include <fx/ds/dict.h>
|
||||
#include <fx/ds/number.h>
|
||||
#include <fx/ds/string.h>
|
||||
#include <fx/serial.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
fx_serial_ctx *ctx = fx_toml_serial_ctx_create();
|
||||
|
||||
fx_dict *dict = fx_dict_create();
|
||||
|
||||
fx_array *array = fx_array_create();
|
||||
fx_array_append(array, FX_RV_INT(32));
|
||||
fx_array_append(array, FX_RV_INT(64));
|
||||
fx_array_append(array, FX_RV_INT(128));
|
||||
|
||||
fx_dict_put(dict, "numbers", FX_RV(array));
|
||||
|
||||
array = fx_array_create();
|
||||
fx_array_append(array, FX_RV_CSTR("hello"));
|
||||
fx_array_append(array, FX_RV_CSTR("world"));
|
||||
|
||||
fx_dict_put(dict, "strings", FX_RV(array));
|
||||
|
||||
fx_object_to_string(dict, fx_stdout);
|
||||
fx_stream_write_char(fx_stdout, '\n');
|
||||
|
||||
fx_serial_ctx_serialise(ctx, dict, fx_stdout, 0);
|
||||
|
||||
fx_dict_unref(dict);
|
||||
fx_serial_ctx_unref(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user