#include "config.h"
#include "plugins/bkpr/sql.c"
#include "plugins/libplugin.c"
#include <common/clock_time.h>
#include <common/json_filter.h>
#include <common/json_stream.h>
#include <common/fee_states.h>
#include <common/setup.h>
#include <common/utils.h>
#include <stdio.h>
#include <wire/wire.h>
u32 find_blockheight(const struct bkpr *bkpr UNNEEDED, const struct bitcoin_txid *txid UNNEEDED)
{ fprintf(stderr, "find_blockheight called!\n"); abort(); }
struct channel_event *new_channel_event(const tal_t *ctx UNNEEDED,
const char *tag UNNEEDED,
struct amount_msat credit UNNEEDED,
struct amount_msat debit UNNEEDED,
struct amount_msat fees UNNEEDED,
const struct sha256 *payment_id TAKES UNNEEDED,
u32 part_id UNNEEDED,
u64 timestamp UNNEEDED)
{ fprintf(stderr, "new_channel_event called!\n"); abort(); }
int main(int argc, char *argv[])
{
common_setup(argv[0]);
const char *s1 = "simple";
const char *r1 = sql_string(tmpctx, s1);
assert(r1 == s1);
const char *s2 = "O'Reilly";
const char *r2 = sql_string(tmpctx, s2);
assert(strcmp(r2, "O''Reilly") == 0);
assert(r2 != s2);
const char *s3 = "'a'b'c'";
const char *r3 = sql_string(tmpctx, s3);
assert(strcmp(r3, "''a''b''c''") == 0);
const char *s4 = "''''";
const char *r4 = sql_string(tmpctx, s4);
assert(strcmp(r4, "''''''''") == 0);
const char *s5 = "";
const char *r5 = sql_string(tmpctx, s5);
assert(r5 == s5);
common_shutdown();
}