From 71856adc5ff5d64c7be1b37854fc8a205d55e482 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Sat, 31 Oct 2026 02:28:17 -0300 Subject: update tests and add beam tests --- test/integration/beam/library.erl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/integration/beam/library.erl (limited to 'test/integration/beam/library.erl') diff --git a/test/integration/beam/library.erl b/test/integration/beam/library.erl new file mode 100644 index 0000000..b9186ab --- /dev/null +++ b/test/integration/beam/library.erl @@ -0,0 +1,19 @@ +-module(library). +-export([books/0]). + +books() -> + from([book(<<"Structure and Interpretation of Computer Programs">>, <<"Harold Abelson">>), + book(<<"The Art of Computer Programming">>, <<"Donald Knuth">>), + book(<<"An Introduction to Database Systems">>, <<"C. J. Date">>), + book(<<"Less Than Words Can Say">>, <<"Richard Mitchell">>), + book(<<"The Graves of Academe">>, <<"Richard Mitchell">>), + book(<<"The Leaning Tower of Babel">>, <<"Richard Mitchell">>), + book(<<"The Gift of Fire">>, <<"Richard Mitchell">>)]). + +book(Title, Author) -> {<<"book">>, #{<<"title">> => Title, <<"author">> => Author}}. + +from(Books) -> + fun(Limit) -> + {Now, Later} = lists:split(min(Limit, length(Books)), Books), + {Now, case Later of [] -> done; _ -> from(Later) end} + end. -- cgit v1.2.3