index 704ebdd48b43ae58cf38b62c8d18fb4c0e1b781c..2da33a19833b5d1204aa39ce2834511cb5e13031 100644 (file)
--- a/t/unit/core/data_test.c
+++ b/t/unit/core/data_test.c
START_TEST(test_format)
{
+ int64_t int_values[] = { 47, 11, 23 };
+ char *string_values[] = { "foo", "bar", "qux", "baz" };
+
struct {
sdb_data_t datum;
const char *expected;
{ SDB_TYPE_REGEX, { .re = { "some regex", empty_re } } },
"\"/some regex/\"",
},
+ {
+ {
+ SDB_TYPE_INTEGER | SDB_TYPE_ARRAY,
+ { .array = { SDB_STATIC_ARRAY_LEN(int_values), int_values } },
+ },
+ "[47, 11, 23]",
+ },
+ {
+ {
+ SDB_TYPE_STRING | SDB_TYPE_ARRAY,
+ { .array = { SDB_STATIC_ARRAY_LEN(string_values), string_values } },
+ },
+ "[\"foo\", \"bar\", \"qux\", \"baz\"]",
+ },
};
size_t i;