git/t/helper/test-json-writer.c

#include "test-tool.h"
#include "json-writer.h"
#include "string-list.h"

static const char *expect_obj1 =;
static const char *expect_obj2 =;
static const char *expect_obj3 =;
static const char *expect_obj4 =;
static const char *expect_obj5 =;
static const char *expect_obj6 =;

static const char *pretty_obj1 =;
static const char *pretty_obj2 =;
static const char *pretty_obj3 =;
static const char *pretty_obj4 =;

static struct json_writer obj1 =;
static struct json_writer obj2 =;
static struct json_writer obj3 =;
static struct json_writer obj4 =;
static struct json_writer obj5 =;
static struct json_writer obj6 =;

static void make_obj1(int pretty)
{}

static void make_obj2(int pretty)
{}

static void make_obj3(int pretty)
{}

static void make_obj4(int pretty)
{}

static void make_obj5(int pretty)
{}

static void make_obj6(int pretty)
{}

static const char *expect_arr1 =;
static const char *expect_arr2 =;
static const char *expect_arr3 =;
static const char *expect_arr4 =;

static const char *pretty_arr1 =;
static const char *pretty_arr2 =;
static const char *pretty_arr3 =;
static const char *pretty_arr4 =;

static struct json_writer arr1 =;
static struct json_writer arr2 =;
static struct json_writer arr3 =;
static struct json_writer arr4 =;

static void make_arr1(int pretty)
{}

static void make_arr2(int pretty)
{}

static void make_arr3(int pretty)
{}

static void make_arr4(int pretty)
{}

static const char *expect_nest1 =;

static struct json_writer nest1 =;

static void make_nest1(int pretty)
{}

static const char *expect_inline1 =;

static const char *pretty_inline1 =;

static struct json_writer inline1 =;

static void make_inline1(int pretty)
{}

static const char *expect_inline2 =;

static const char *pretty_inline2 =;

static struct json_writer inline2 =;

static void make_inline2(int pretty)
{}

/*
 * When super is compact, we expect subs to be compacted (even if originally
 * pretty).
 */
static const char *expect_mixed1 =;

/*
 * When super is pretty, a compact sub (obj1) is kept compact and a pretty
 * sub (arr1) is re-indented.
 */
static const char *pretty_mixed1 =;

static struct json_writer mixed1 =;

static void make_mixed1(int pretty)
{}

static void cmp(const char *test, const struct json_writer *jw, const char *exp)
{}

#define t(v)
#define p(v)

/*
 * Run some basic regression tests with some known patterns.
 * These tests also demonstrate how to use the jw_ API.
 */
static int unit_tests(void)
{}

struct line {};

static void get_s(struct line *line, char **s_in)
{}

static void get_i(struct line *line, intmax_t *s_in)
{}

static void get_d(struct line *line, double *s_in)
{}

static int pretty;

#define MAX_LINE_LENGTH

static char *get_trimmed_line(char *buf, int buf_size)
{}

static int scripted(void)
{}

int cmd__json_writer(int argc, const char **argv)
{}