#include #include #include "../src/piece-table.h" int main() { piece_table *pt = piece_table_create("0123456789"); piece_table_delete(pt, 0, 10); if (strcmp(piece_table_to_string(pt), "")) return 1; piece_table_destroy(pt); pt = piece_table_create("0123456789"); piece_table_delete(pt, 0, 1); if (strcmp(piece_table_to_string(pt), "123456789")) return 2; piece_table_destroy(pt); pt = piece_table_create("0123456789"); piece_table_delete(pt, 9, 1); if (strcmp(piece_table_to_string(pt), "012345678")) return 3; piece_table_destroy(pt); pt = piece_table_create("0123456789"); piece_table_delete(pt, 7, 1); piece_table_delete(pt, 0, 1); if (strcmp(piece_table_to_string(pt), "12345689")) return 4; piece_table_destroy(pt); return 0; }