static void test_append_str(void) {
        const char *string = "foo";
        char buf[strlen(string)];
        char *out = buf;
        size_t n_out = sizeof(buf);
        int r;

        r = c_shquote_append_str(&out, &n_out, string, strlen(string));
        c_assert(!r);
        c_assert(!memcmp(buf, string, strlen(string)));
        c_assert(out == buf + strlen(string));
        c_assert(n_out == sizeof(buf) - strlen(string));

        r = c_shquote_append_str(&out, &n_out, string, 1);
        c_assert(r == C_SHQUOTE_E_NO_SPACE);
}
static void test_append_str(void) {
        const char *string = "foo";
        char buf[strlen(string)];
        char *out = buf;
        size_t n_out = sizeof(buf);
        int r;

        r = c_shquote_append_str(&out, &n_out, string, strlen(string));
        c_assert(!r);
        c_assert(!memcmp(buf, string, strlen(string)));
        c_assert(out == buf + strlen(string));
        c_assert(n_out == sizeof(buf) - strlen(string));

        r = c_shquote_append_str(&out, &n_out, string, 1);
        c_assert(r == C_SHQUOTE_E_NO_SPACE);
}