diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | tests/piece-table-delete.c | 10 | ||||
-rw-r--r-- | tests/piece-table-print.c | 9 |
3 files changed, 23 insertions, 2 deletions
@@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -g -Werror -Wall -Wpedantic +CFLAGS = -g -Wall -Wpedantic TARGET = parc BASENM = buffer piece-table SRC = $(addsuffix .c, $(addprefix src/, $(BASENM)) ) @@ -8,7 +8,9 @@ OBJ = $(addsuffix .o, $(addprefix $(OBJDIR)/, $(BASENM))) HEADERS = $(wildcard src/*.h) -TEST := buffer +TEST := buffer\ + piece-table-print\ + piece-table-delete TEST_FILES = $(addprefix tests/, $(TEST)) TEST_SOURCES = $(addsuffix .c, $(addprefix tests/, $(TEST))) diff --git a/tests/piece-table-delete.c b/tests/piece-table-delete.c new file mode 100644 index 0000000..e46753a --- /dev/null +++ b/tests/piece-table-delete.c @@ -0,0 +1,10 @@ +#include "../src/piece-table.h" + +int main() { + piece_table pt; + init_piece_table(&pt, "1234567890"); + delete_piece_table(&pt, 0, 10); + print_piece_table(&pt); + free_piece_table(&pt); + return 0; +} diff --git a/tests/piece-table-print.c b/tests/piece-table-print.c new file mode 100644 index 0000000..2b927be --- /dev/null +++ b/tests/piece-table-print.c @@ -0,0 +1,9 @@ +#include "../src/piece-table.h" + +int main() { + piece_table pt; + init_piece_table(&pt, "Hola esto es un texto de prueba"); + print_piece_table(&pt); + free_piece_table(&pt); + return 0; +} |