Commit Graph

19 Commits

Author SHA1 Message Date
Aryadev Chavali
7f2dcc3ad2 alisp.org: mark TODOs 2026-03-05 17:32:52 +00:00
Aryadev Chavali
30a87d4a1b some small updates 2026-03-05 17:32:52 +00:00
Aryadev Chavali
79f53c7916 alisp.org: rework TODOs, setup one for allocators. 2026-02-12 23:03:05 +00:00
Aryadev Chavali
7df292ed9e alisp.org: mark WIP -> TODO 2026-02-11 10:31:23 +00:00
Aryadev Chavali
4aad62fec9 alisp.org: update 2026-02-11 10:29:57 +00:00
Aryadev Chavali
04be0ecad0 alisp.org: update todos 2026-02-11 10:29:57 +00:00
Aryadev Chavali
93a52db7cc alisp.org: add TODO about reader macros 2026-02-11 10:29:57 +00:00
Aryadev Chavali
d88bc2baeb alisp.org: mark some TODOs 2026-02-11 10:29:57 +00:00
oreodave
a6d3d861b7 sv: add a few more functions
* alisp.org: reset state of Unit tests to TODO

* alisp.org: take sv_t tasks out of the backlog and set to WIP

* sv: add prototypes for sv_chop_{left,right} and sv_substr

* sv: implement sv_chop_{left, right} and sv_substr

* sv: sv_till and sv_while

* sv: add sv_truncate

When you just want to decrease to a specific size, sv_chop_right is a
bit cumbersome.

* alisp.org: Update and adjust
2026-02-06 07:02:10 +00:00
oreodave
a65964e2f7 tests: refactor testing and implement a bunch of tests
* tests: split of symtable testing into its own suite

makes sense to be there, not in the lisp API

* tests: Added string view suite

sv_copy is the only function, but we may have others later.

* tests: Meaningful and pretty logging for tests

* tests: slight cleanliness

* tests: c23 allows you to inline stack allocated arrays in struct decls

* test: Added definition to make default testing less verbose

TEST_VERBOSE is a preprocesser directive which TEST is dependent on.
By default it is 0, in which case TEST simply fails if the condition
is not true.  Otherwise, a full log (as done previously) is made.

* Makefile: added mode flag for full logs

MODE=full will initialise a debug build with all logs, including test
logs.  Otherwise, MODE=debug just sets up standard debug build with
main logs but no testing logs.  MODE=release optimises and strips all
logs.

* tests: fix size of LISP_API_SUITE tests

* test_lisp_api: int_test -> smi_test, added smi_oob_test

* test_lisp_api: sym_test -> sym_fresh_test

* test_lisp_api: added sym_unique_test

* alisp.org: Added some tasks

* symtable: sym_table_cleanup -> sym_table_free

* lisp: split off lisp_free as it's own function

lisp_free will do a shallow clean of any object, freeing its
associated memory.  It won't recur through any containers, nor will it
freakout if you give it something that is constant (symbols, small
integers, NIL, etc).

* test_lisp_api: added sys_test

* test_stream: basic skeleton

* test_stream: implement stream_test_string

* test_stream: Enable only stream_test_string

* tests: enable STREAM_SUITE

* sv: fix possible runtime issue with NULL SV's in sv_copy

* alisp.org: add TODOs for all the tests required for streams

* tests: Better suite creation

While the previous method of in-lining a stack allocated array of
tests into the suite struct declaration was nice, we had to update
size manually.

This macro will allow us to just append new tests to the suite without
having to care for that.  It generates a uniquely named variable for
the test array, then uses that test array in the suite declaration.
Nice and easy.

* test: TEST_INIT macro as a prologue for any unit test

* main: Put all variable declarations at start of main to ensure decl

There is a chance that /end/ is jumped to without the FILE pointer or
stream actually being declared.  This deals with that.

* stream: Make stream name a constant cstr

We don't deal with the memory for it anyway.

* stream: do not initialise file streams with a non-empty vector

Because of the not_inlined trick, a 0 initialised SBO vector is
completely valid to use if required.  Future /vec_ensure/'s will deal
with it appropriately.  So there's no need to initialise the vector
ahead of time like this.

* test_stream: implement stream_test_file

We might need to setup a prelude for initialising a file in the
filesystem for testing here - not only does stream_test_file need it,
but I see later tests requiring an equivalence check for files and
strings (variants of a stream).

* test_stream: setup prologue and epilogue as fake tests in the suite

Standard old test functions, but they don't call TEST_INIT or
TEST_PASSED.  They're placed at the start and at the end of the test
array.

Those macros just do printing anyway, so they're not necessary.

* tests: TEST_INIT -> TEST_START, TEST_PASSED -> TEST_END

* tests: TEST_START only logs if TEST_VERBOSE is enabled.

* test_lisp_api: "cons'" -> "conses"

* alisp.org: Mark off completed stream_test_file

* test_stream: implement stream_test_peek_next

* test_stream: randomise filename

Just to make sure it's not hardcoded or anything.

* test_stream: make filename bigger, and increase the random alphabet

* test: seed random number generator

* test_stream: don't write null terminator to mock file

* stream: stream_seek will do clamped movement if offset is invalid

If a forward/backward offset is too big, we'll clamp to the edges of
the file rather than failing completely.  We return the number of
bytes moved so callers can still validate, but the stream API can now
deal with these situations a bit more effectively.

* test_stream: implement stream_test_seek

* stream: ensure stream_stop resets the FILE pointer if STREAM_TYPE_FILE

* stream: stream_substr's call to stream_seek_forward refactored

Following stream_seek_forward's own refactor, where we get offsets
back instead of just a boolean, we should verify that offset.

* main: put stream_stop before FILE pointer close

As stream_stop requires a valid FILE pointer (fseek), we need to do it
before we close the pipe.

* test_vec: vec_test_substr -> vec_test_gen_substr

* test_stream: implement stream_test_substr

* alisp: add TODO for sv_t
2026-02-06 06:08:13 +00:00
Aryadev Chavali
40ef094b68 alisp.org: Remove notes and overview
Not needed with what we're doing currently.  I'll make proper
documentation when I'm done.
2026-02-05 04:35:54 +00:00
Aryadev Chavali
656226c050 alisp.org: make a backlog for tasks 2026-02-05 04:35:47 +00:00
Aryadev Chavali
030a289497 Some changes to how streams work, clean up alisp.org 2025-09-01 21:47:25 +01:00
Aryadev Chavali
66c6400731 Made a load of tasks for a reader system, also task for BigIntegers 2025-08-22 00:29:12 +01:00
Aryadev Chavali
ed37f7cd80 cons_test written 2025-08-21 21:27:01 +01:00
Aryadev Chavali
29b18bc1de Finish value constructors TODO, start container constructors TODO 2025-08-21 14:56:24 +01:00
Aryadev Chavali
742f19886c Designed tests for make_int and intern with their destructors 2025-08-21 08:35:32 +01:00
Aryadev Chavali
7853f637c0 Some more notes 2025-08-21 00:30:07 +01:00
Aryadev Chavali
5ac3cbe6c2 Made an "issue tracker" and note holder 2025-08-21 00:07:06 +01:00