From 61efa9140383db4bcd2d4ce56982f0459ace454d Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 5 Feb 2026 06:32:26 +0000 Subject: [PATCH] alisp.org: add TODOs for all the tests required for streams --- alisp.org | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/alisp.org b/alisp.org index 64ac5cc..a11efe6 100644 --- a/alisp.org +++ b/alisp.org @@ -45,13 +45,58 @@ i.e. no parsing. *** DONE Design what a "parser function" would look like The general function is something like ~stream -> T | Err~. What other state do we need to encode? -*** WIP Write a parser for integers +*** TODO Write a parser for integers *** TODO Write a parser for symbols *** TODO Write a parser for lists *** TODO Write a parser for vectors *** TODO Write the general parser ** WIP Unit tests :tests: *** TODO Test streams +**** TODO Test file init +[[file:test/test_stream.c::void stream_test_file(void)]] +***** TODO Test successful init from real files +Ensure stream_size is 0 i.e. we don't read anything on creation. +Also ensure stream_eoc is false. +***** TODO Test failed init from fake files +**** TODO Test peeking and next +[[file:test/test_stream.c::void stream_test_peek_next(void)]] +- Peeking with bad streams ('\0' return) +- Peeking with good streams (no effect on position) +- Next with bad streams ('\0' return, no effect on position) +- Next with good streams (effects position) +- Peeking after next (should just work) +**** TODO Test seeking +[[file:test/test_stream.c::void stream_test_seek(void)]] +- Seeking forward/backward on a bad stream (should stop at 0) +- Seeking forward/backward too far (should clamp) +- Seeking forward/backward zero sum via relative index (stream_seek) +**** TODO Test substring +[[file:test/test_stream.c::void stream_test_substr(void)]] +- Substr on bad stream (NULL sv) +- Substr on bad position/size (NULL sv) +- Substr relative/absolute (good SV) +**** TODO Test till +[[file:test/test_stream.c::void stream_test_till(void)]] +- till on a bad stream (NULL SV) +- till on an ended stream (NULL SV) +- till on a stream with no items in search string (eoc) +- till on a stream with all items in search string (no effect) +- till on a stream with prefix being all search string (no effect) +- till on a stream with suffix being all search string (stops at + suffix) +**** TODO Test while +[[file:test/test_stream.c::void stream_test_while(void)]] +- while on a bad stream (NULL SV) +- while on an ended stream (NULL SV) +- while on a stream with no items in search string (no effect) +- while on a stream with all items in search string (eoc) +- while on a stream with prefix being all search string (effect) +- while on a stream with suffix being all search string (no effect) +**** TODO Test line_col +[[file:test/test_stream.c::void stream_test_line_col(void)]] +- line_col on bad stream (no effect on args) +- line_col on eoc stream (should go right to the end) +- line_col on random points in a stream *** DONE Test system registration of allocated units In particular, does clean up work as we expect? Do we have situations where we may double free or not clean up something we should've?