about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-02-19 00:01:34 -0500
committerJune McEnroe <june@causal.agency>2022-02-19 00:01:34 -0500
commit06d17aa8f114360f2b5a3e6e1fa011bfc2d806ba (patch)
tree3f870e8e9319d430fa7710721d0722d9c42f7cf9
parentImplement new line editing "library" (diff)
downloadcatgirl-06d17aa8f114360f2b5a3e6e1fa011bfc2d806ba.tar.gz
catgirl-06d17aa8f114360f2b5a3e6e1fa011bfc2d806ba.zip
Run line editing tests
I know, it feels wrong.
-rw-r--r--.gitignore1
-rw-r--r--Makefile16
2 files changed, 14 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index e96e0c1..b31d1c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 *.o
+*.t
 catgirl
 chroot.tar
 config.mk
diff --git a/Makefile b/Makefile
index 9e6392b..fccee7f 100644
--- a/Makefile
+++ b/Makefile
@@ -25,20 +25,30 @@ OBJS += ui.o
 OBJS += url.o
 OBJS += xdg.o
 
-dev: tags all
+TESTS += edit.t
+
+dev: tags all check
 
 all: catgirl
 
 catgirl: ${OBJS}
 	${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
 
-${OBJS}: chat.h edit.h
+${OBJS} ${TESTS}: chat.h edit.h
+
+check: ${TESTS}
+
+.SUFFIXES: .t
+
+.c.t:
+	${CC} ${CFLAGS} -DTEST ${LDFLAGS} $< ${LDLIBS} -o $@
+	./$@ || rm $@
 
 tags: *.[ch]
 	ctags -w *.[ch]
 
 clean:
-	rm -f catgirl ${OBJS} tags
+	rm -f catgirl ${OBJS} ${TESTS} tags
 
 install: catgirl catgirl.1
 	install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1
dbf83fa&follow=1'>Remove unneeded includes in ui.cJune McEnroe 2022-02-19Reimplement tab completeJune McEnroe 2022-02-19Handle errors from editFn, etc.June McEnroe 2022-02-19Reimplement text macrosJune McEnroe 2022-02-19Factor out input handling to input.cJune McEnroe 2022-02-19Factor out window management to window.cJune McEnroe 2022-02-19Enable -Wmissing-prototypesJune McEnroe In other words, warn when a function is missing static. I don't see why this isn't in -Wextra. 2022-02-19Fix edit.[ch] license notice additional permissionsJune McEnroe 2022-02-19Run line editing testsJune McEnroe I know, it feels wrong. 2022-02-18Implement new line editing "library"June McEnroe Losing tab complete and text macros, for now. This new implementation works on an instance of a struct and does not interact with the rest of catgirl, making it possible to copy into another project. Unlike existing line editing libraries, this one is entirely abstract and can be rendered externally. My goal with this library is to be able to implement vi mode. Since it operates on struct instances rather than globals, it might also be possible to give catgirl separate line editing buffers for each window, which would be a nice UX improvement. 2022-02-18Simplify cursor positioning in inputJune McEnroe Do some extra work by adding the portion before the cursor to the input window twice, but simplify the interaction with the split point. This fixes the awkward behaviour when moving the cursor across colour codes where the code would be partially interpreted up to the cursor. 2022-02-18Fix M-f orderingJune McEnroe 2022-02-12Move sandman build to scripts/MakefileJune McEnroe 2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe 2022-02-12Copy RPP defines from oconfigureJune McEnroe