diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-31 02:28:17 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-31 02:28:17 -0300 |
| commit | 71856adc5ff5d64c7be1b37854fc8a205d55e482 (patch) | |
| tree | 25770cf98154c0da696878228783ac8faecde08b /test/integration/beam/library.erl | |
| parent | e76cc6f862656a3ada9fa3d4418bd060df937885 (diff) | |
| download | RNT-71856adc5ff5d64c7be1b37854fc8a205d55e482.tar.gz RNT-71856adc5ff5d64c7be1b37854fc8a205d55e482.zip | |
update tests and add beam tests
Diffstat (limited to 'test/integration/beam/library.erl')
| -rw-r--r-- | test/integration/beam/library.erl | 19 |
1 files changed, 19 insertions, 0 deletions
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. |
