diff options
author | HJ <thechairman@thechairman.info> | 2024-02-03 15:09:54 -0500 |
---|---|---|
committer | HJ <thechairman@thechairman.info> | 2024-02-03 15:09:54 -0500 |
commit | 96a3c5c179d8d3fff24eb2953e45f8dd15e2714c (patch) | |
tree | 0a67bc0cfeabe51740bb049c61f16f1ac3bdd4ff /aoc2023/build/dev/erlang/adglent | |
parent | 547fe03cf43105f46160e2dd9afff21637eaaf47 (diff) | |
download | gleam_aoc-96a3c5c179d8d3fff24eb2953e45f8dd15e2714c.tar.gz gleam_aoc-96a3c5c179d8d3fff24eb2953e45f8dd15e2714c.zip |
cleanup
Diffstat (limited to 'aoc2023/build/dev/erlang/adglent')
174 files changed, 3424 insertions, 0 deletions
diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.cache Binary files differnew file mode 100644 index 0000000..939bda2 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.cache_meta Binary files differnew file mode 100644 index 0000000..0af4a84 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.erl new file mode 100644 index 0000000..e3ceebe --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent.erl @@ -0,0 +1,55 @@ +-module(adglent). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([inspect/1, get_input/1, get_test_folder/1, start_arguments/0, get_part/0]). +-export_type([example/1, problem/0, charlist/0]). + +-type example(ODD) :: {example, binary(), ODD}. + +-type problem() :: first | second. + +-type charlist() :: any(). + +-spec inspect(any()) -> binary(). +inspect(Value) -> + Inspected_value = gleam@string:inspect(Value), + case begin + _pipe = Inspected_value, + gleam@string:starts_with(_pipe, <<"\""/utf8>>) + end of + true -> + _pipe@1 = Inspected_value, + _pipe@2 = gleam@string:drop_left(_pipe@1, 1), + gleam@string:drop_right(_pipe@2, 1); + + false -> + Inspected_value + end. + +-spec get_input(binary()) -> {ok, binary()} | {error, simplifile:file_error()}. +get_input(Day) -> + simplifile:read( + <<<<"src/day"/utf8, Day/binary>>/binary, "/input.txt"/utf8>> + ). + +-spec get_test_folder(binary()) -> binary(). +get_test_folder(Day) -> + <<"test/day"/utf8, Day/binary>>. + +-spec start_arguments() -> list(binary()). +start_arguments() -> + _pipe = init:get_plain_arguments(), + gleam@list:map(_pipe, fun unicode:characters_to_binary/1). + +-spec get_part() -> {ok, problem()} | {error, nil}. +get_part() -> + case start_arguments() of + [<<"1"/utf8>>] -> + {ok, first}; + + [<<"2"/utf8>>] -> + {ok, second}; + + _ -> + {error, nil} + end. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.cache Binary files differnew file mode 100644 index 0000000..a39d38a --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.cache_meta Binary files differnew file mode 100644 index 0000000..1637f81 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.erl new file mode 100644 index 0000000..b80368f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@day.erl @@ -0,0 +1,278 @@ +-module(adglent@day). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([main/0]). + +-spec create_file_if_not_present(binary(), binary()) -> {ok, binary()} | + {error, binary()}. +create_file_if_not_present(Content, Path) -> + case simplifile:is_file(Path) of + true -> + {ok, <<Path/binary, " already exists - skipped"/utf8>>}; + + false -> + gleam@result:'try'( + begin + _pipe = simplifile:create_file(Path), + priv@errors:map_messages( + _pipe, + <<"Created "/utf8, Path/binary>>, + <<"Could not create "/utf8, Path/binary>> + ) + end, + fun(_) -> _pipe@1 = simplifile:write(Path, Content), + priv@errors:map_messages( + _pipe@1, + <<"Wrote "/utf8, Path/binary>>, + <<"Could not write to "/utf8, Path/binary>> + ) end + ) + end. + +-spec main() -> binary(). +main() -> + Day@1 = begin + _pipe = case adglent:start_arguments() of + [Day] -> + {ok, Day}; + + Args -> + {error, + <<"Expected day - found: "/utf8, + (gleam@string:join(Args, <<", "/utf8>>))/binary>>} + end, + _pipe@1 = priv@errors:map_error( + _pipe, + <<"Error when parsing command args"/utf8>> + ), + _pipe@2 = priv@errors:print_error(_pipe@1), + priv@errors:assert_ok(_pipe@2) + end, + Aoc_toml = begin + _pipe@3 = simplifile:read(<<"aoc.toml"/utf8>>), + _pipe@4 = priv@errors:map_error( + _pipe@3, + <<"Could not read aoc.toml"/utf8>> + ), + _pipe@5 = priv@errors:print_error(_pipe@4), + priv@errors:assert_ok(_pipe@5) + end, + Aoc_toml_version = priv@toml:get_int(Aoc_toml, [<<"version"/utf8>>]), + Year = begin + _pipe@6 = priv@toml:get_string(Aoc_toml, [<<"year"/utf8>>]), + _pipe@7 = priv@errors:map_error( + _pipe@6, + <<"Could not read \"year\" from aoc.toml"/utf8>> + ), + _pipe@8 = priv@errors:print_error(_pipe@7), + priv@errors:assert_ok(_pipe@8) + end, + Session = begin + _pipe@9 = priv@toml:get_string(Aoc_toml, [<<"session"/utf8>>]), + _pipe@10 = priv@errors:map_error( + _pipe@9, + <<"Could not read \"session\" from aoc.toml"/utf8>> + ), + _pipe@11 = priv@errors:print_error(_pipe@10), + priv@errors:assert_ok(_pipe@11) + end, + Showtime = case Aoc_toml_version of + {ok, 2} -> + _pipe@12 = priv@toml:get_bool(Aoc_toml, [<<"showtime"/utf8>>]), + _pipe@13 = priv@errors:map_error( + _pipe@12, + <<"Could not read \"showtime\" from aoc.toml"/utf8>> + ), + _pipe@14 = priv@errors:print_error(_pipe@13), + priv@errors:assert_ok(_pipe@14); + + _ -> + _pipe@15 = priv@toml:get_string(Aoc_toml, [<<"showtime"/utf8>>]), + _pipe@16 = gleam@result:map( + _pipe@15, + fun(Bool_string) -> case Bool_string of + <<"True"/utf8>> -> + true; + + _ -> + false + end end + ), + _pipe@17 = priv@errors:map_error( + _pipe@16, + <<"Could not read \"showtime\" from aoc.toml"/utf8>> + ), + _pipe@18 = priv@errors:print_error(_pipe@17), + priv@errors:assert_ok(_pipe@18) + end, + Test_folder = adglent:get_test_folder(Day@1), + Test_file = <<<<<<Test_folder/binary, "/day"/utf8>>/binary, Day@1/binary>>/binary, + "_test.gleam"/utf8>>, + _pipe@19 = simplifile:create_directory_all(Test_folder), + _pipe@20 = priv@errors:map_error( + _pipe@19, + <<<<"Could not create folder \""/utf8, Test_folder/binary>>/binary, + "\""/utf8>> + ), + _pipe@21 = priv@errors:print_error(_pipe@20), + priv@errors:assert_ok(_pipe@21), + Testfile_template = case Showtime of + true -> + <<" +import gleam/list +import showtime/tests/should +import adglent.{type Example, Example} +import day{{ day }}/solve + +type Problem1AnswerType = + String + +type Problem2AnswerType = + String + +/// Add examples for part 1 here: +/// ```gleam +///const part1_examples: List(Example(Problem1AnswerType)) = [Example(\"some input\", \"\")] +/// ``` +const part1_examples: List(Example(Problem1AnswerType)) = [] + +/// Add examples for part 2 here: +/// ```gleam +///const part2_examples: List(Example(Problem2AnswerType)) = [Example(\"some input\", \"\")] +/// ``` +const part2_examples: List(Example(Problem2AnswerType)) = [] + +pub fn part1_test() { + part1_examples + |> should.not_equal([]) + use example <- list.map(part1_examples) + solve.part1(example.input) + |> should.equal(example.answer) +} + +pub fn part2_test() { + part2_examples + |> should.not_equal([]) + use example <- list.map(part2_examples) + solve.part2(example.input) + |> should.equal(example.answer) +} + +"/utf8>>; + + false -> + <<" +import gleam/list +import gleeunit/should +import adglent.{type Example, Example} +import day{{ day }}/solve + +type Problem1AnswerType = + String + +type Problem2AnswerType = + String + +/// Add examples for part 1 here: +/// ```gleam +///const part1_examples: List(Example(Problem1AnswerType)) = [Example(\"some input\", \"\")] +/// ``` +const part1_examples: List(Example(Problem1AnswerType)) = [] + +/// Add examples for part 2 here: +/// ```gleam +///const part2_examples: List(Example(Problem2AnswerType)) = [Example(\"some input\", \"\")] +/// ``` +const part2_examples: List(Example(Problem2AnswerType)) = [] + +pub fn part1_test() { + part1_examples + |> should.not_equal([]) + use example <- list.map(part1_examples) + solve.part1(example.input) + |> should.equal(example.answer) +} + +pub fn part2_test() { + part2_examples + |> should.not_equal([]) + use example <- list.map(part2_examples) + solve.part2(example.input) + |> should.equal(example.answer) +} + +"/utf8>> + end, + _pipe@22 = priv@template:render( + Testfile_template, + [{<<"day"/utf8>>, Day@1}] + ), + _pipe@23 = create_file_if_not_present(_pipe@22, Test_file), + _pipe@24 = priv@errors:print_result(_pipe@23), + priv@errors:assert_ok(_pipe@24), + Solutions_folder = <<"src/day"/utf8, Day@1/binary>>, + Solution_file = <<Solutions_folder/binary, "/solve.gleam"/utf8>>, + _pipe@25 = simplifile:create_directory_all(Solutions_folder), + _pipe@26 = priv@errors:map_error( + _pipe@25, + <<<<"Could not create folder \""/utf8, Solutions_folder/binary>>/binary, + "\""/utf8>> + ), + _pipe@27 = priv@errors:print_error(_pipe@26), + priv@errors:assert_ok(_pipe@27), + _pipe@28 = priv@template:render( + <<" +import adglent.{First, Second} +import gleam/io + +pub fn part1(input: String) { + todo as \"Implement solution to part 1\" +} + +pub fn part2(input: String) { + todo as \"Implement solution to part 2\" +} + +pub fn main() { + let assert Ok(part) = adglent.get_part() + let assert Ok(input) = adglent.get_input(\"{{ day }}\") + case part { + First -> + part1(input) + |> adglent.inspect + |> io.println + Second -> + part2(input) + |> adglent.inspect + |> io.println + } +} +"/utf8>>, + [{<<"day"/utf8>>, Day@1}] + ), + _pipe@29 = create_file_if_not_present(_pipe@28, Solution_file), + _pipe@30 = priv@errors:print_result(_pipe@29), + priv@errors:assert_ok(_pipe@30), + _pipe@31 = create_file_if_not_present( + <<"input.txt"/utf8>>, + <<Solutions_folder/binary, "/.gitignore"/utf8>> + ), + _pipe@32 = priv@errors:print_result(_pipe@31), + priv@errors:assert_ok(_pipe@32), + Input = begin + _pipe@33 = priv@aoc_client:get_input(Year, Day@1, Session), + _pipe@34 = priv@errors:map_error( + _pipe@33, + <<"Error when fetching input"/utf8>> + ), + _pipe@35 = priv@errors:print_error(_pipe@34), + priv@errors:assert_ok(_pipe@35) + end, + _pipe@36 = Input, + _pipe@37 = gleam@string:trim(_pipe@36), + _pipe@38 = create_file_if_not_present( + _pipe@37, + <<Solutions_folder/binary, "/input.txt"/utf8>> + ), + _pipe@39 = priv@errors:print_result(_pipe@38), + priv@errors:assert_ok(_pipe@39). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.cache Binary files differnew file mode 100644 index 0000000..5337c50 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.cache_meta Binary files differnew file mode 100644 index 0000000..2751b68 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.erl new file mode 100644 index 0000000..fb28101 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent@init.erl @@ -0,0 +1,142 @@ +-module(adglent@init). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([main/0]). + +-spec main() -> {ok, binary()} | {error, binary()}. +main() -> + Year = priv@prompt:value(<<"Year"/utf8>>, <<"2023"/utf8>>, false), + Session = priv@prompt:value(<<"Session Cookie"/utf8>>, <<""/utf8>>, false), + Use_showtime = priv@prompt:confirm(<<"Use showtime"/utf8>>, false), + Aoc_toml_file = <<"aoc.toml"/utf8>>, + Overwrite = case simplifile:create_file(Aoc_toml_file) of + {ok, _} -> + true; + + {error, eexist} -> + priv@prompt:confirm(<<"aoc.toml exits - overwrite"/utf8>>, false); + + _ -> + erlang:error(#{gleam_error => panic, + message => <<"Could not create aoc.toml"/utf8>>, + module => <<"adglent/init"/utf8>>, + function => <<"main"/utf8>>, + line => 29}) + end, + _pipe@3 = case Overwrite of + true -> + _pipe@1 = priv@template:render( + <<" +version = {{ version }} +year = \"{{ year }}\" +session = \"{{ session }}\" +showtime = {{ showtime }} +"/utf8>>, + [{<<"version"/utf8>>, <<"2"/utf8>>}, + {<<"year"/utf8>>, Year}, + {<<"session"/utf8>>, Session}, + {<<"showtime"/utf8>>, + begin + _pipe = gleam@bool:to_string(Use_showtime), + gleam@string:lowercase(_pipe) + end}] + ), + _pipe@2 = simplifile:write(Aoc_toml_file, _pipe@1), + priv@errors:map_messages( + _pipe@2, + <<"aoc.toml - written"/utf8>>, + <<"Error when writing aoc.toml"/utf8>> + ); + + false -> + {ok, <<"aoc.toml - skipped"/utf8>>} + end, + priv@errors:print_result(_pipe@3), + Gleam_toml = begin + _pipe@4 = simplifile:read(<<"gleam.toml"/utf8>>), + _pipe@5 = priv@errors:map_error( + _pipe@4, + <<"Could not read gleam.toml"/utf8>> + ), + _pipe@6 = priv@errors:print_error(_pipe@5), + priv@errors:assert_ok(_pipe@6) + end, + Name = begin + _pipe@7 = priv@toml:get_string(Gleam_toml, [<<"name"/utf8>>]), + _pipe@8 = priv@errors:map_error( + _pipe@7, + <<"Could not read \"name\" from gleam.toml"/utf8>> + ), + _pipe@9 = priv@errors:print_error(_pipe@8), + priv@errors:assert_ok(_pipe@9) + end, + Test_main_file = <<<<"test/"/utf8, Name/binary>>/binary, + "_test.gleam"/utf8>>, + _pipe@12 = case Use_showtime of + true -> + _pipe@10 = priv@template:render( + <<" +import showtime + +pub fn main() { + showtime.main() +} +"/utf8>>, + [] + ), + _pipe@11 = simplifile:write(Test_main_file, _pipe@10), + priv@errors:map_messages( + _pipe@11, + <<"Wrote "/utf8, Test_main_file/binary>>, + <<"Could not write to "/utf8, Test_main_file/binary>> + ); + + false -> + {ok, <<"Using existing (gleeunit) "/utf8, Test_main_file/binary>>} + end, + _pipe@13 = priv@errors:print_result(_pipe@12), + priv@errors:assert_ok(_pipe@13), + _pipe@17 = case simplifile:is_file(<<".gitignore"/utf8>>) of + true -> + gleam@result:'try'( + begin + _pipe@14 = simplifile:read(<<".gitignore"/utf8>>), + gleam@result:map_error( + _pipe@14, + fun(Err) -> + <<"Could not read .gitignore: "/utf8, + (gleam@string:inspect(Err))/binary>> + end + ) + end, + fun(Gitignore) -> + Aoc_toml_ignored = begin + _pipe@15 = gleam@string:split(Gitignore, <<"\n"/utf8>>), + gleam@list:find( + _pipe@15, + fun(Line) -> Line =:= <<"aoc.toml"/utf8>> end + ) + end, + case Aoc_toml_ignored of + {error, _} -> + _pipe@16 = simplifile:append( + <<".gitignore"/utf8>>, + <<"\naoc.toml"/utf8>> + ), + priv@errors:map_messages( + _pipe@16, + <<".gitignore written"/utf8>>, + <<"Error when writing .gitignore"/utf8>> + ); + + {ok, _} -> + {ok, + <<".gitignore - skipped (already configured)"/utf8>>} + end + end + ); + + false -> + {error, <<"Could not find .gitignore"/utf8>>} + end, + priv@errors:print_result(_pipe@17). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent_ffi.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent_ffi.erl new file mode 100644 index 0000000..a6a92e6 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/adglent_ffi.erl @@ -0,0 +1,12 @@ +-module(adglent_ffi). + +-export([get_line/1]). + +-spec get_line(io:prompt()) -> {ok, unicode:unicode_binary()} | {error, eof | no_data}. +get_line(Prompt) -> + case io:get_line(Prompt) of + eof -> {error, eof}; + {error, _} -> {error, no_data}; + Data when is_binary(Data) -> {ok, Data}; + Data when is_list(Data) -> {ok, unicode:characters_to_binary(Data)} + end. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/gleam@@compile.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/gleam@@compile.erl new file mode 100644 index 0000000..543db88 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/gleam@@compile.erl @@ -0,0 +1,157 @@ +#!/usr/bin/env escript + +% TODO: Don't concurrently print warnings and errors +% TODO: Some tests + +-record(arguments, {lib = "./", out = "./", modules = []}). + +main(Args) -> + #arguments{out = Out, lib = Lib, modules = Modules} = parse(Args), + IsElixirModule = fun(Module) -> + filename:extension(Module) =:= ".ex" + end, + {ElixirModules, ErlangModules} = lists:partition(IsElixirModule, Modules), + ok = configure_logging(), + ok = add_lib_to_erlang_path(Lib), + ok = filelib:ensure_dir([Out, $/]), + {ErlangOk, _ErlangBeams} = compile_erlang(ErlangModules, Out), + {ElixirOk, _ElixirBeams} = case ErlangOk of + true -> compile_elixir(ElixirModules, Out); + false -> {false, []} + end, + case ErlangOk and ElixirOk of + true -> ok; + false -> erlang:halt(1) + end. + +compile_erlang(Modules, Out) -> + Workers = start_compiler_workers(Out), + ok = producer_loop(Modules, Workers), + collect_results({true, []}). + +collect_results(Acc = {Result, Beams}) -> + receive + {compiled, Beam} -> collect_results({Result, [Beam | Beams]}); + failed -> collect_results({false, Beams}) + after 0 -> Acc + end. + +producer_loop([], 0) -> + ok; +producer_loop([], Workers) -> + receive + {work_please, _} -> producer_loop([], Workers - 1) + end; +producer_loop([Module | Modules], Workers) -> + receive + {work_please, Worker} -> + erlang:send(Worker, {module, Module}), + producer_loop(Modules, Workers) + end. + +start_compiler_workers(Out) -> + Parent = self(), + NumSchedulers = erlang:system_info(schedulers), + SpawnWorker = fun(_) -> + erlang:spawn_link(fun() -> worker_loop(Parent, Out) end) + end, + lists:foreach(SpawnWorker, lists:seq(1, NumSchedulers)), + NumSchedulers. + +worker_loop(Parent, Out) -> + Options = [report_errors, report_warnings, debug_info, {outdir, Out}], + erlang:send(Parent, {work_please, self()}), + receive + {module, Module} -> + log({compiling, Module}), + case compile:file(Module, Options) of + {ok, ModuleName} -> + Beam = filename:join(Out, ModuleName) ++ ".beam", + Message = {compiled, Beam}, + log(Message), + erlang:send(Parent, Message); + error -> + log({failed, Module}), + erlang:send(Parent, failed) + end, + worker_loop(Parent, Out) + end. + +compile_elixir(Modules, Out) -> + Error = [ + "The program elixir was not found. Is it installed?", + $\n, + "Documentation for installing Elixir can be viewed here:", + $\n, + "https://elixir-lang.org/install.html" + ], + case Modules of + [] -> {true, []}; + _ -> + log({starting, "compiler.app"}), + ok = application:start(compiler), + log({starting, "elixir.app"}), + case application:start(elixir) of + ok -> do_compile_elixir(Modules, Out); + _ -> + io:put_chars(standard_error, [Error, $\n]), + {false, []} + end + end. + +do_compile_elixir(Modules, Out) -> + ModuleBins = lists:map(fun(Module) -> + log({compiling, Module}), + list_to_binary(Module) + end, Modules), + OutBin = list_to_binary(Out), + Options = [{dest, OutBin}], + % Silence "redefining module" warnings. + % Compiled modules in the build directory are added to the code path. + % These warnings result from recompiling loaded modules. + % TODO: This line can likely be removed if/when the build directory is cleaned before every compilation. + 'Elixir.Code':compiler_options([{ignore_module_conflict, true}]), + case 'Elixir.Kernel.ParallelCompiler':compile_to_path(ModuleBins, OutBin, Options) of + {ok, ModuleAtoms, _} -> + ToBeam = fun(ModuleAtom) -> + Beam = filename:join(Out, atom_to_list(ModuleAtom)) ++ ".beam", + log({compiled, Beam}), + Beam + end, + {true, lists:map(ToBeam, ModuleAtoms)}; + {error, Errors, _} -> + % Log all filenames associated with modules that failed to compile. + % Note: The compiler prints compilation errors upon encountering them. + ErrorFiles = lists:usort([File || {File, _, _} <- Errors]), + Log = fun(File) -> + log({failed, binary_to_list(File)}) + end, + lists:foreach(Log, ErrorFiles), + {false, []}; + _ -> {false, []} + end. + +add_lib_to_erlang_path(Lib) -> + code:add_paths(filelib:wildcard([Lib, "/*/ebin"])). + +parse(Args) -> + parse(Args, #arguments{}). + +parse([], Arguments) -> + Arguments; +parse(["--lib", Lib | Rest], Arguments) -> + parse(Rest, Arguments#arguments{lib = Lib}); +parse(["--out", Out | Rest], Arguments) -> + parse(Rest, Arguments#arguments{out = Out}); +parse([Module | Rest], Arguments = #arguments{modules = Modules}) -> + parse(Rest, Arguments#arguments{modules = [Module | Modules]}). + +configure_logging() -> + Enabled = os:getenv("GLEAM_LOG") /= false, + persistent_term:put(gleam_logging_enabled, Enabled). + +log(Term) -> + case persistent_term:get(gleam_logging_enabled) of + true -> erlang:display(Term), ok; + false -> ok + end. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.cache Binary files differnew file mode 100644 index 0000000..40f6caf --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.cache_meta Binary files differnew file mode 100644 index 0000000..b6c1617 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.erl new file mode 100644 index 0000000..1acb9b5 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@aoc_client.erl @@ -0,0 +1,61 @@ +-module(priv@aoc_client). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([get_input/3]). + +-spec get_input(binary(), binary(), binary()) -> {ok, binary()} | + {error, binary()}. +get_input(Year, Day, Session) -> + Url = <<<<<<<<"https://adventofcode.com/"/utf8, Year/binary>>/binary, + "/day/"/utf8>>/binary, + Day/binary>>/binary, + "/input"/utf8>>, + gleam@result:'try'( + begin + _pipe = gleam@http@request:to(Url), + gleam@result:map_error( + _pipe, + fun(Error) -> + <<<<<<"Could not create request for \""/utf8, Url/binary>>/binary, + "\": "/utf8>>/binary, + (gleam@string:inspect(Error))/binary>> + end + ) + end, + fun(Request) -> + gleam@result:'try'( + begin + _pipe@1 = Request, + _pipe@2 = gleam@http@request:prepend_header( + _pipe@1, + <<"Accept"/utf8>>, + <<"application/json"/utf8>> + ), + _pipe@3 = gleam@http@request:prepend_header( + _pipe@2, + <<"Cookie"/utf8>>, + <<<<"session="/utf8, Session/binary>>/binary, ";"/utf8>> + ), + _pipe@4 = gleam@httpc:send(_pipe@3), + gleam@result:map_error( + _pipe@4, + fun(Error@1) -> + <<<<<<"Error when requesting \""/utf8, Url/binary>>/binary, + "\": "/utf8>>/binary, + (gleam@string:inspect(Error@1))/binary>> + end + ) + end, + fun(Response) -> case erlang:element(2, Response) of + Status when (Status >= 200) andalso (Status < 300) -> + {ok, erlang:element(4, Response)}; + + Status@1 -> + {error, + <<<<(gleam@int:to_string(Status@1))/binary, + " - "/utf8>>/binary, + (erlang:element(4, Response))/binary>>} + end end + ) + end + ). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.cache Binary files differnew file mode 100644 index 0000000..7bfeea9 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.cache_meta Binary files differnew file mode 100644 index 0000000..498e302 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.erl new file mode 100644 index 0000000..41545be --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@errors.erl @@ -0,0 +1,74 @@ +-module(priv@errors). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([map_messages/3, map_error/2, print_result/1, print_error/1, assert_ok/1]). + +-spec map_messages({ok, any()} | {error, any()}, binary(), binary()) -> {ok, + binary()} | + {error, binary()}. +map_messages(Result, Success_message, Error_message) -> + _pipe = Result, + _pipe@1 = gleam@result:map_error( + _pipe, + fun(Error) -> + <<<<<<"Error - "/utf8, Error_message/binary>>/binary, ": "/utf8>>/binary, + (gleam@string:inspect(Error))/binary>> + end + ), + gleam@result:replace(_pipe@1, Success_message). + +-spec map_error({ok, OBD} | {error, any()}, binary()) -> {ok, OBD} | + {error, binary()}. +map_error(Result, Error_message) -> + _pipe = Result, + gleam@result:map_error( + _pipe, + fun(Error) -> + <<<<Error_message/binary, ": "/utf8>>/binary, + (gleam@string:inspect(Error))/binary>> + end + ). + +-spec print_result({ok, binary()} | {error, binary()}) -> {ok, binary()} | + {error, binary()}. +print_result(Result) -> + _pipe = Result, + _pipe@1 = gleam@result:unwrap_both(_pipe), + gleam@io:println(_pipe@1), + Result. + +-spec print_error({ok, OBM} | {error, binary()}) -> {ok, OBM} | + {error, binary()}. +print_error(Result) -> + _pipe = Result, + gleam@result:map_error( + _pipe, + fun(Err) -> + gleam@io:println(Err), + Err + end + ). + +-spec assert_ok({ok, OBQ} | {error, binary()}) -> OBQ. +assert_ok(Result) -> + _assert_subject = begin + _pipe = Result, + gleam@result:map_error( + _pipe, + fun(Err) -> + erlang:halt(1), + Err + end + ) + end, + {ok, Value} = case _assert_subject of + {ok, _} -> _assert_subject; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"priv/errors"/utf8>>, + function => <<"assert_ok"/utf8>>, + line => 43}) + end, + Value. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.cache Binary files differnew file mode 100644 index 0000000..45d6e3e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.cache_meta Binary files differnew file mode 100644 index 0000000..b010daf --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.erl new file mode 100644 index 0000000..0277f14 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@prompt.erl @@ -0,0 +1,53 @@ +-module(priv@prompt). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([get_line/1, confirm/2, value/3]). +-export_type([get_line_error/0]). + +-type get_line_error() :: eof | no_data. + +-spec get_line(binary()) -> {ok, binary()} | {error, get_line_error()}. +get_line(Prompt) -> + adglent_ffi:get_line(Prompt). + +-spec confirm(binary(), boolean()) -> boolean(). +confirm(Message, Auto_accept) -> + Auto_accept orelse case begin + _pipe = adglent_ffi:get_line(<<Message/binary, "? (Y/N): "/utf8>>), + _pipe@1 = gleam@result:unwrap(_pipe, <<"n"/utf8>>), + gleam@string:trim(_pipe@1) + end of + <<"Y"/utf8>> -> + true; + + <<"y"/utf8>> -> + true; + + _ -> + false + end. + +-spec get_value_of_default(binary(), binary(), boolean()) -> binary(). +get_value_of_default(Message, Default, Auto_accept) -> + case Auto_accept of + true -> + Default; + + false -> + _pipe = adglent_ffi:get_line( + <<<<<<Message/binary, "? ("/utf8>>/binary, Default/binary>>/binary, + "): "/utf8>> + ), + _pipe@1 = gleam@result:unwrap(_pipe, <<""/utf8>>), + gleam@string:trim(_pipe@1) + end. + +-spec value(binary(), binary(), boolean()) -> binary(). +value(Message, Default, Auto_accept) -> + case get_value_of_default(Message, Default, Auto_accept) of + <<""/utf8>> -> + Default; + + Value -> + Value + end. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.cache Binary files differnew file mode 100644 index 0000000..8446302 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.cache_meta Binary files differnew file mode 100644 index 0000000..5e1f919 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.erl new file mode 100644 index 0000000..6a5d0bf --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@template.erl @@ -0,0 +1,25 @@ +-module(priv@template). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([render/2]). + +-spec render(binary(), list({binary(), binary()})) -> binary(). +render(Template, Substitutions) -> + <<(begin + _pipe = Substitutions, + _pipe@2 = gleam@list:fold( + _pipe, + Template, + fun(Template@1, Substitution) -> + {Name, Value} = Substitution, + _pipe@1 = Template@1, + gleam@string:replace( + _pipe@1, + <<<<"{{ "/utf8, Name/binary>>/binary, " }}"/utf8>>, + Value + ) + end + ), + gleam@string:trim(_pipe@2) + end)/binary, + "\n"/utf8>>. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.cache Binary files differnew file mode 100644 index 0000000..d29fd97 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.cache_meta Binary files differnew file mode 100644 index 0000000..3397840 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.erl new file mode 100644 index 0000000..7e36387 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@solution.erl @@ -0,0 +1 @@ +-module(priv@templates@solution). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.cache Binary files differnew file mode 100644 index 0000000..8cdc9df --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.cache_meta Binary files differnew file mode 100644 index 0000000..17c867f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.erl new file mode 100644 index 0000000..ca6b127 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@test_main.erl @@ -0,0 +1 @@ +-module(priv@templates@test_main). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.cache Binary files differnew file mode 100644 index 0000000..2003723 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.cache_meta Binary files differnew file mode 100644 index 0000000..c996833 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.erl new file mode 100644 index 0000000..2f5a41e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_gleeunit.erl @@ -0,0 +1 @@ +-module(priv@templates@testfile_gleeunit). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.cache Binary files differnew file mode 100644 index 0000000..155ee1e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.cache_meta Binary files differnew file mode 100644 index 0000000..120c91f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.erl new file mode 100644 index 0000000..bbbc8b2 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@templates@testfile_showtime.erl @@ -0,0 +1 @@ +-module(priv@templates@testfile_showtime). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.cache Binary files differnew file mode 100644 index 0000000..e328098 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.cache_meta Binary files differnew file mode 100644 index 0000000..a423083 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.erl new file mode 100644 index 0000000..6c41fbf --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/priv@toml.erl @@ -0,0 +1,83 @@ +-module(priv@toml). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([get_string/2, get_bool/2, get_int/2]). +-export_type([tom_error/0]). + +-type tom_error() :: {tom_parse_error, tom:parse_error()} | + {tom_get_error, tom:get_error()}. + +-spec get_string(binary(), list(binary())) -> {ok, binary()} | + {error, tom_error()}. +get_string(Toml_content, Key_path) -> + gleam@result:'try'( + begin + _pipe = tom:parse(<<Toml_content/binary, "\n"/utf8>>), + gleam@result:map_error( + _pipe, + fun(Field@0) -> {tom_parse_error, Field@0} end + ) + end, + fun(Toml) -> + gleam@result:'try'( + begin + _pipe@1 = tom:get_string(Toml, Key_path), + gleam@result:map_error( + _pipe@1, + fun(Field@0) -> {tom_get_error, Field@0} end + ) + end, + fun(Value) -> {ok, Value} end + ) + end + ). + +-spec get_bool(binary(), list(binary())) -> {ok, boolean()} | + {error, tom_error()}. +get_bool(Toml_content, Key_path) -> + gleam@result:'try'( + begin + _pipe = tom:parse(<<Toml_content/binary, "\n"/utf8>>), + gleam@result:map_error( + _pipe, + fun(Field@0) -> {tom_parse_error, Field@0} end + ) + end, + fun(Toml) -> + gleam@result:'try'( + begin + _pipe@1 = tom:get_bool(Toml, Key_path), + gleam@result:map_error( + _pipe@1, + fun(Field@0) -> {tom_get_error, Field@0} end + ) + end, + fun(Value) -> {ok, Value} end + ) + end + ). + +-spec get_int(binary(), list(binary())) -> {ok, integer()} | + {error, tom_error()}. +get_int(Toml_content, Key_path) -> + gleam@result:'try'( + begin + _pipe = tom:parse(<<Toml_content/binary, "\n"/utf8>>), + gleam@result:map_error( + _pipe, + fun(Field@0) -> {tom_parse_error, Field@0} end + ) + end, + fun(Toml) -> + gleam@result:'try'( + begin + _pipe@1 = tom:get_int(Toml, Key_path), + gleam@result:map_error( + _pipe@1, + fun(Field@0) -> {tom_get_error, Field@0} end + ) + end, + fun(Value) -> {ok, Value} end + ) + end + ). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.cache Binary files differnew file mode 100644 index 0000000..19b5f6b --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.cache_meta Binary files differnew file mode 100644 index 0000000..96a5705 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.erl new file mode 100644 index 0000000..d4c0030 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime.erl @@ -0,0 +1,155 @@ +-module(showtime). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([main/0]). + +-spec mk_runner( + fun((gleam@option:option(list(binary())), list(binary()), showtime@internal@common@cli:capture()) -> NYW), + glint:command_input() +) -> NYW. +mk_runner(Func, Command) -> + _assert_subject = begin + _pipe = erlang:element(3, Command), + _pipe@1 = glint@flag:get_strings(_pipe, <<"modules"/utf8>>), + gleam@result:map(_pipe@1, fun(Modules) -> case Modules of + [] -> + none; + + Modules@1 -> + {some, Modules@1} + end end) + end, + {ok, Module_list} = case _assert_subject of + {ok, _} -> _assert_subject; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"showtime"/utf8>>, + function => <<"mk_runner"/utf8>>, + line => 91}) + end, + _assert_subject@1 = begin + _pipe@2 = erlang:element(3, Command), + glint@flag:get_strings(_pipe@2, <<"ignore"/utf8>>) + end, + {ok, Ignore_tags} = case _assert_subject@1 of + {ok, _} -> _assert_subject@1; + _assert_fail@1 -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail@1, + module => <<"showtime"/utf8>>, + function => <<"mk_runner"/utf8>>, + line => 100}) + end, + _assert_subject@2 = begin + _pipe@3 = erlang:element(3, Command), + _pipe@4 = glint@flag:get_string(_pipe@3, <<"capture"/utf8>>), + _pipe@5 = gleam@result:map( + _pipe@4, + fun(Arg) -> gleam@string:lowercase(Arg) end + ), + gleam@result:map(_pipe@5, fun(Arg@1) -> case Arg@1 of + <<"no"/utf8>> -> + no; + + <<"yes"/utf8>> -> + yes; + + <<"mixed"/utf8>> -> + mixed + end end) + end, + {ok, Capture_output} = case _assert_subject@2 of + {ok, _} -> _assert_subject@2; + _assert_fail@2 -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail@2, + module => <<"showtime"/utf8>>, + function => <<"mk_runner"/utf8>>, + line => 104}) + end, + Func(Module_list, Ignore_tags, Capture_output). + +-spec start_with_args( + list(binary()), + fun((gleam@option:option(list(binary())), list(binary()), showtime@internal@common@cli:capture()) -> any()) +) -> nil. +start_with_args(Args, Func) -> + Modules_flag = begin + _pipe = glint@flag:string_list(), + _pipe@1 = glint@flag:default(_pipe, []), + glint@flag:description( + _pipe@1, + <<"Run only tests in the modules in this list"/utf8>> + ) + end, + Ignore_flag = begin + _pipe@2 = glint@flag:string_list(), + _pipe@3 = glint@flag:default(_pipe@2, []), + glint@flag:description( + _pipe@3, + <<"Ignore tests that are have tags matching a tag in this list"/utf8>> + ) + end, + Capture_flag = begin + _pipe@4 = glint@flag:string(), + _pipe@5 = glint@flag:default(_pipe@4, <<"no"/utf8>>), + _pipe@6 = glint@flag:constraint( + _pipe@5, + glint@flag@constraint:one_of( + [<<"yes"/utf8>>, <<"no"/utf8>>, <<"mixed"/utf8>>] + ) + ), + glint@flag:description( + _pipe@6, + <<"Capture output: no (default) - output when tests are run, yes - output is captured and shown in report, mixed - output when run and in report"/utf8>> + ) + end, + _pipe@7 = glint:new(), + _pipe@12 = glint:add( + _pipe@7, + [], + begin + _pipe@8 = glint:command( + fun(_capture) -> mk_runner(Func, _capture) end + ), + _pipe@9 = glint:flag(_pipe@8, <<"modules"/utf8>>, Modules_flag), + _pipe@10 = glint:flag(_pipe@9, <<"ignore"/utf8>>, Ignore_flag), + _pipe@11 = glint:flag(_pipe@10, <<"capture"/utf8>>, Capture_flag), + glint:description(_pipe@11, <<"Runs test"/utf8>>) + end + ), + _pipe@13 = glint:with_pretty_help(_pipe@12, glint:default_pretty_help()), + glint:run(_pipe@13, Args). + +-spec main() -> nil. +main() -> + start_with_args( + gleam@erlang:start_arguments(), + fun(Module_list, Ignore_tags, Capture) -> + Test_event_handler = showtime@internal@erlang@event_handler:start(), + Test_module_handler = showtime@internal@erlang@module_handler:start( + Test_event_handler, + fun showtime@internal@erlang@discover:collect_test_functions/1, + fun showtime@internal@erlang@runner:run_test_suite/4, + Ignore_tags, + Capture + ), + Test_event_handler(start_test_run), + Modules = showtime@internal@erlang@discover:collect_modules( + Test_module_handler, + Module_list + ), + Test_event_handler( + {end_test_run, + begin + _pipe = Modules, + gleam@list:length(_pipe) + end} + ), + nil + end + ). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.cache Binary files differnew file mode 100644 index 0000000..0dded35 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.cache_meta Binary files differnew file mode 100644 index 0000000..4c3ebd3 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.erl new file mode 100644 index 0000000..f2d2396 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@cli.erl @@ -0,0 +1,8 @@ +-module(showtime@internal@common@cli). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export_type([capture/0]). + +-type capture() :: yes | no | mixed. + + diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.cache Binary files differnew file mode 100644 index 0000000..df75ed9 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.cache_meta Binary files differnew file mode 100644 index 0000000..cea0c4b --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.erl new file mode 100644 index 0000000..5ee9a85 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@common_event_handler.erl @@ -0,0 +1,131 @@ +-module(showtime@internal@common@common_event_handler). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([handle_event/3]). +-export_type([test_state/0, handler_state/0]). + +-type test_state() :: not_started | running | {finished, integer()}. + +-type handler_state() :: {handler_state, + test_state(), + integer(), + gleam@dict:dict(binary(), gleam@dict:dict(binary(), showtime@internal@common@test_suite:test_run()))}. + +-spec handle_event( + showtime@internal@common@test_suite:test_event(), + fun(() -> integer()), + handler_state() +) -> handler_state(). +handle_event(Msg, System_time, State) -> + Test_state = erlang:element(2, State), + Num_done = erlang:element(3, State), + Events = erlang:element(4, State), + {Updated_test_state, Updated_num_done, Updated_events} = case Msg of + start_test_run -> + {running, Num_done, Events}; + + {start_test_suite, Module} -> + Maybe_module_events = gleam@map:get( + Events, + erlang:element(2, Module) + ), + New_events = case Maybe_module_events of + {ok, _} -> + Events; + + {error, _} -> + _pipe = Events, + gleam@map:insert( + _pipe, + erlang:element(2, Module), + gleam@map:new() + ) + end, + {Test_state, Num_done, New_events}; + + {start_test, Module@1, Test} -> + Current_time = System_time(), + Maybe_module_events@1 = gleam@map:get( + Events, + erlang:element(2, Module@1) + ), + New_events@1 = case Maybe_module_events@1 of + {ok, Module_events} -> + Maybe_test_event = gleam@map:get( + Module_events, + erlang:element(2, Test) + ), + case Maybe_test_event of + {error, _} -> + _pipe@1 = Events, + gleam@map:insert( + _pipe@1, + erlang:element(2, Module@1), + begin + _pipe@2 = Module_events, + gleam@map:insert( + _pipe@2, + erlang:element(2, Test), + {ongoing_test_run, Test, Current_time} + ) + end + ); + + {ok, _} -> + Events + end; + + {error, _} -> + Events + end, + {Test_state, Num_done, New_events@1}; + + {end_test, Module@2, Test@1, Result} -> + Current_time@1 = System_time(), + Maybe_module_events@2 = gleam@map:get( + Events, + erlang:element(2, Module@2) + ), + New_events@2 = case Maybe_module_events@2 of + {ok, Module_events@1} -> + Maybe_test_run = begin + _pipe@3 = Module_events@1, + gleam@map:get(_pipe@3, erlang:element(2, Test@1)) + end, + Updated_module_events = case Maybe_test_run of + {ok, {ongoing_test_run, Test_function, Started_at}} -> + _pipe@4 = Module_events@1, + gleam@map:insert( + _pipe@4, + erlang:element(2, Test@1), + {completed_test_run, + Test_function, + Current_time@1 - Started_at, + Result} + ); + + {error, _} -> + Module_events@1 + end, + _pipe@5 = Events, + gleam@map:insert( + _pipe@5, + erlang:element(2, Module@2), + Updated_module_events + ); + + {error, _} -> + Events + end, + {Test_state, Num_done, New_events@2}; + + {end_test_suite, _} -> + {Test_state, Num_done + 1, Events}; + + {end_test_run, Num_modules} -> + {{finished, Num_modules}, Num_done, Events}; + + _ -> + {running, Num_done, Events} + end, + {handler_state, Updated_test_state, Updated_num_done, Updated_events}. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.cache Binary files differnew file mode 100644 index 0000000..c0f776e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.cache_meta Binary files differnew file mode 100644 index 0000000..ae0cd95 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.erl new file mode 100644 index 0000000..7f62f4f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_result.erl @@ -0,0 +1,54 @@ +-module(showtime@internal@common@test_result). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export_type([ignore_reason/0, test_return/0, exception/0, reason/0, reason_detail/0, gleam_error_detail/0, class/0, trace_list/0, trace/0, extra_info/0, arity_/0]). + +-type ignore_reason() :: ignore. + +-type test_return() :: {test_function_return, + gleam@dynamic:dynamic_(), + list(binary())} | + {ignored, ignore_reason()}. + +-type exception() :: {erlang_exception, + class(), + reason(), + trace_list(), + list(binary())}. + +-type reason() :: {assert_equal, list(reason_detail())} | + {assert_not_equal, list(reason_detail())} | + {assert_match, list(reason_detail())} | + {gleam_error, gleam_error_detail()} | + {gleam_assert, gleam@dynamic:dynamic_(), integer()} | + {generic_exception, gleam@dynamic:dynamic_()}. + +-type reason_detail() :: {module, binary()} | + {reason_line, integer()} | + {expression, binary()} | + {expected, gleam@dynamic:dynamic_()} | + {value, gleam@dynamic:dynamic_()} | + {pattern, binary()}. + +-type gleam_error_detail() :: {let_assert, + binary(), + binary(), + integer(), + binary(), + gleam@dynamic:dynamic_()}. + +-type class() :: erlang_error | exit | throw. + +-type trace_list() :: {trace_list, list(trace())}. + +-type trace() :: {trace, binary(), arity_(), list(extra_info())} | + {trace_module, binary(), binary(), arity_(), list(extra_info())}. + +-type extra_info() :: {error_info, + gleam@dict:dict(gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_())} | + {file, binary()} | + {line, integer()}. + +-type arity_() :: {num, integer()} | {arg_list, list(gleam@dynamic:dynamic_())}. + + diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.cache Binary files differnew file mode 100644 index 0000000..80885b8 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.cache_meta Binary files differnew file mode 100644 index 0000000..b2139f9 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.erl new file mode 100644 index 0000000..6a56de8 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@common@test_suite.erl @@ -0,0 +1,30 @@ +-module(showtime@internal@common@test_suite). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export_type([test_run/0, test_module/0, test_function/0, test_suite/0, test_event/0]). + +-type test_run() :: {ongoing_test_run, test_function(), integer()} | + {completed_test_run, + test_function(), + integer(), + {ok, showtime@internal@common@test_result:test_return()} | + {error, showtime@internal@common@test_result:exception()}}. + +-type test_module() :: {test_module, binary(), gleam@option:option(binary())}. + +-type test_function() :: {test_function, binary()}. + +-type test_suite() :: {test_suite, test_module(), list(test_function())}. + +-type test_event() :: start_test_run | + {start_test_suite, test_module()} | + {start_test, test_module(), test_function()} | + {end_test, + test_module(), + test_function(), + {ok, showtime@internal@common@test_result:test_return()} | + {error, showtime@internal@common@test_result:exception()}} | + {end_test_suite, test_module()} | + {end_test_run, integer()}. + + diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.cache Binary files differnew file mode 100644 index 0000000..68f7428 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.cache_meta Binary files differnew file mode 100644 index 0000000..236dd39 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.erl new file mode 100644 index 0000000..f0548aa --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@discover.erl @@ -0,0 +1,230 @@ +-module(showtime@internal@erlang@discover). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([collect_modules/2, collect_test_functions/1]). + +-spec get_module_prefix(binary()) -> binary(). +get_module_prefix(Path) -> + Path_without_test = begin + _pipe = Path, + gleam@string:replace(_pipe, <<"./test"/utf8>>, <<""/utf8>>) + end, + Path_without_leading_slash = case gleam@string:starts_with( + Path_without_test, + <<"/"/utf8>> + ) of + true -> + gleam@string:drop_left(Path_without_test, 1); + + false -> + Path_without_test + end, + Module_prefix = begin + _pipe@1 = Path_without_leading_slash, + gleam@string:replace(_pipe@1, <<"/"/utf8>>, <<"@"/utf8>>) + end, + case gleam@string:length(Module_prefix) of + 0 -> + Module_prefix; + + _ -> + <<Module_prefix/binary, "@"/utf8>> + end. + +-spec collect_modules_in_folder( + binary(), + fun((showtime@internal@common@test_suite:test_module()) -> nil), + gleam@option:option(list(binary())) +) -> list(showtime@internal@common@test_suite:test_module()). +collect_modules_in_folder(Path, Test_module_handler, Only_modules) -> + Module_prefix = get_module_prefix(Path), + _assert_subject = simplifile:read_directory(Path), + {ok, Files} = case _assert_subject of + {ok, _} -> _assert_subject; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"showtime/internal/erlang/discover"/utf8>>, + function => <<"collect_modules_in_folder"/utf8>>, + line => 40}) + end, + Test_modules_in_folder = begin + _pipe = Files, + _pipe@1 = gleam@list:filter( + _pipe, + fun(_capture) -> + gleam@string:ends_with(_capture, <<"_test.gleam"/utf8>>) + end + ), + gleam@list:filter_map( + _pipe@1, + fun(Test_module_file) -> + Module_name = <<Module_prefix/binary, + (begin + _pipe@2 = Test_module_file, + gleam@string:replace( + _pipe@2, + <<".gleam"/utf8>>, + <<""/utf8>> + ) + end)/binary>>, + case Only_modules of + {some, Only_modules_list} -> + Module_in_list = begin + _pipe@3 = Only_modules_list, + gleam@list:any( + _pipe@3, + fun(Only_module_name) -> + Only_module_name =:= begin + _pipe@4 = Module_name, + gleam@string:replace( + _pipe@4, + <<"@"/utf8>>, + <<"/"/utf8>> + ) + end + end + ) + end, + case Module_in_list of + true -> + Test_module = {test_module, + Module_name, + {some, Test_module_file}}, + Test_module_handler(Test_module), + {ok, Test_module}; + + false -> + {error, nil} + end; + + none -> + Test_module@1 = {test_module, + Module_name, + {some, Test_module_file}}, + Test_module_handler(Test_module@1), + {ok, Test_module@1} + end + end + ) + end, + Test_modules_in_subfolders = begin + _pipe@5 = Files, + _pipe@6 = gleam@list:map( + _pipe@5, + fun(Filename) -> + <<<<Path/binary, "/"/utf8>>/binary, Filename/binary>> + end + ), + _pipe@7 = gleam@list:filter( + _pipe@6, + fun(File) -> simplifile:is_directory(File) end + ), + gleam@list:fold( + _pipe@7, + [], + fun(Modules, Subfolder) -> _pipe@8 = Modules, + gleam@list:append( + _pipe@8, + collect_modules_in_folder( + Subfolder, + Test_module_handler, + Only_modules + ) + ) end + ) + end, + _pipe@9 = Test_modules_in_folder, + gleam@list:append(_pipe@9, Test_modules_in_subfolders). + +-spec collect_modules( + fun((showtime@internal@common@test_suite:test_module()) -> nil), + gleam@option:option(list(binary())) +) -> list(showtime@internal@common@test_suite:test_module()). +collect_modules(Test_module_handler, Only_modules) -> + collect_modules_in_folder( + <<"./test"/utf8>>, + Test_module_handler, + Only_modules + ). + +-spec collect_test_functions(showtime@internal@common@test_suite:test_module()) -> showtime@internal@common@test_suite:test_suite(). +collect_test_functions(Module) -> + Test_functions = begin + _pipe = erlang:apply( + erlang:binary_to_atom(erlang:element(2, Module)), + erlang:binary_to_atom(<<"module_info"/utf8>>), + [gleam@dynamic:from(erlang:binary_to_atom(<<"exports"/utf8>>))] + ), + gleam@dynamic:unsafe_coerce(_pipe) + end, + Test_functions_filtered = begin + _pipe@1 = Test_functions, + _pipe@3 = gleam@list:map( + _pipe@1, + fun(Entry) -> + {Name, Arity} = case Entry of + {_, _} -> Entry; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"showtime/internal/erlang/discover"/utf8>>, + function => <<"collect_test_functions"/utf8>>, + line => 131}) + end, + {begin + _pipe@2 = Name, + erlang:atom_to_binary(_pipe@2) + end, + Arity} + end + ), + _pipe@4 = gleam@list:filter_map( + _pipe@3, + fun(Entry@1) -> + {Name@1, Arity@1} = case Entry@1 of + {_, _} -> Entry@1; + _assert_fail@1 -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail@1, + module => <<"showtime/internal/erlang/discover"/utf8>>, + function => <<"collect_test_functions"/utf8>>, + line => 139}) + end, + case gleam@string:ends_with(Name@1, <<"_test"/utf8>>) of + true -> + case Arity@1 of + 0 -> + {ok, Name@1}; + + _ -> + gleam@io:println( + <<<<<<<<"WARNING: function \""/utf8, + Name@1/binary>>/binary, + "\" has arity: "/utf8>>/binary, + (gleam@int:to_string(Arity@1))/binary>>/binary, + " - cannot be used as test (needs to be 0)"/utf8>> + ), + {error, <<"Wrong arity"/utf8>>} + end; + + false -> + {error, <<"Non matching name"/utf8>>} + end + end + ), + _pipe@5 = gleam@list:filter( + _pipe@4, + fun(_capture) -> + gleam@string:ends_with(_capture, <<"_test"/utf8>>) + end + ), + gleam@list:map( + _pipe@5, + fun(Function_name) -> {test_function, Function_name} end + ) + end, + {test_suite, Module, Test_functions_filtered}. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.cache Binary files differnew file mode 100644 index 0000000..60fea12 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.cache_meta Binary files differnew file mode 100644 index 0000000..1223c48 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.erl new file mode 100644 index 0000000..d72ce2c --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@event_handler.erl @@ -0,0 +1,76 @@ +-module(showtime@internal@erlang@event_handler). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([start/0]). +-export_type([event_handler_message/0]). + +-type event_handler_message() :: {event_handler_message, + showtime@internal@common@test_suite:test_event(), + gleam@erlang@process:subject(integer())}. + +-spec system_time() -> integer(). +system_time() -> + os:system_time(millisecond). + +-spec start() -> fun((showtime@internal@common@test_suite:test_event()) -> nil). +start() -> + _assert_subject = gleam@otp@actor:start( + {not_started, 0, gleam@map:new()}, + fun(Msg, State) -> + {event_handler_message, Test_event, Reply_to} = Msg, + {Test_state, Num_done, Events} = State, + Updated_state = showtime@internal@common@common_event_handler:handle_event( + Test_event, + fun system_time/0, + {handler_state, Test_state, Num_done, Events} + ), + case Updated_state of + {handler_state, {finished, Num_modules}, Num_done@1, Events@1} when Num_done@1 =:= Num_modules -> + {Test_report, Num_failed} = showtime@internal@reports@formatter:create_test_report( + Events@1 + ), + gleam@io:println(Test_report), + gleam@erlang@process:send(Reply_to, Num_failed), + {stop, normal}; + + {handler_state, Test_state@1, Num_done@2, Events@2} -> + {continue, {Test_state@1, Num_done@2, Events@2}, none} + end + end + ), + {ok, Subject} = case _assert_subject of + {ok, _} -> _assert_subject; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"showtime/internal/erlang/event_handler"/utf8>>, + function => <<"start"/utf8>>, + line => 32}) + end, + Parent_subject = gleam@erlang@process:new_subject(), + Selector = begin + _pipe = gleam_erlang_ffi:new_selector(), + gleam@erlang@process:selecting(_pipe, Parent_subject, fun(X) -> X end) + end, + fun(Test_event@1) -> case Test_event@1 of + {end_test_run, _} -> + gleam@erlang@process:send( + Subject, + {event_handler_message, Test_event@1, Parent_subject} + ), + Num_failed@1 = gleam_erlang_ffi:select(Selector), + case Num_failed@1 > 0 of + true -> + erlang:halt(1); + + false -> + erlang:halt(0) + end; + + _ -> + gleam@erlang@process:send( + Subject, + {event_handler_message, Test_event@1, Parent_subject} + ) + end end. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.cache Binary files differnew file mode 100644 index 0000000..6b896ec --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.cache_meta Binary files differnew file mode 100644 index 0000000..7cd0c75 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.erl new file mode 100644 index 0000000..a6959f5 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@module_handler.erl @@ -0,0 +1,53 @@ +-module(showtime@internal@erlang@module_handler). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([start/5]). + +-spec start( + fun((showtime@internal@common@test_suite:test_event()) -> nil), + fun((showtime@internal@common@test_suite:test_module()) -> showtime@internal@common@test_suite:test_suite()), + fun((showtime@internal@common@test_suite:test_suite(), fun((showtime@internal@common@test_suite:test_event()) -> nil), list(binary()), showtime@internal@common@cli:capture()) -> nil), + list(binary()), + showtime@internal@common@cli:capture() +) -> fun((showtime@internal@common@test_suite:test_module()) -> nil). +start( + Test_event_handler, + Test_function_collector, + Run_test_suite, + Ignore_tags, + Capture +) -> + _assert_subject = gleam@otp@actor:start( + nil, + fun(Module, State) -> + gleam@erlang@process:start( + fun() -> + Test_suite = Test_function_collector(Module), + Test_event_handler({start_test_suite, Module}), + Run_test_suite( + Test_suite, + Test_event_handler, + Ignore_tags, + Capture + ), + Test_event_handler({end_test_suite, Module}) + end, + false + ), + {continue, State, none} + end + ), + {ok, Subject} = case _assert_subject of + {ok, _} -> _assert_subject; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"showtime/internal/erlang/module_handler"/utf8>>, + function => <<"start"/utf8>>, + line => 23}) + end, + fun(Test_module) -> + gleam@erlang@process:send(Subject, Test_module), + nil + end. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.cache Binary files differnew file mode 100644 index 0000000..91e7663 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.cache_meta Binary files differnew file mode 100644 index 0000000..069c9cf --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.erl new file mode 100644 index 0000000..702fb75 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@erlang@runner.erl @@ -0,0 +1,46 @@ +-module(showtime@internal@erlang@runner). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([run_test/4, run_test_suite/4]). + +-spec run_test( + binary(), + binary(), + list(binary()), + showtime@internal@common@cli:capture() +) -> {ok, showtime@internal@common@test_result:test_return()} | + {error, showtime@internal@common@test_result:exception()}. +run_test(Module_name, Test_name, Ignore_tags, Capture) -> + Result = showtime_ffi:run_test( + erlang:binary_to_atom(Module_name), + erlang:binary_to_atom(Test_name), + Ignore_tags, + Capture + ), + Result. + +-spec run_test_suite( + showtime@internal@common@test_suite:test_suite(), + fun((showtime@internal@common@test_suite:test_event()) -> nil), + list(binary()), + showtime@internal@common@cli:capture() +) -> nil. +run_test_suite(Test_suite, Test_event_handler, Ignore_tags, Capture) -> + _pipe = erlang:element(3, Test_suite), + gleam@list:each( + _pipe, + fun(Test) -> + Test_event_handler( + {start_test, erlang:element(2, Test_suite), Test} + ), + Result = run_test( + erlang:element(2, erlang:element(2, Test_suite)), + erlang:element(2, Test), + Ignore_tags, + Capture + ), + Test_event_handler( + {end_test, erlang:element(2, Test_suite), Test, Result} + ) + end + ). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.cache Binary files differnew file mode 100644 index 0000000..bf88ac7 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.cache_meta Binary files differnew file mode 100644 index 0000000..be99189 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.erl new file mode 100644 index 0000000..d2969b2 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@compare.erl @@ -0,0 +1,61 @@ +-module(showtime@internal@reports@compare). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([compare/2]). + +-spec compare(gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_()) -> {binary(), + binary()}. +compare(Expected, Got) -> + Expected_as_list = begin + _pipe = Expected, + (gleam@dynamic:list(fun gleam@dynamic:dynamic/1))(_pipe) + end, + Got_as_list = begin + _pipe@1 = Got, + (gleam@dynamic:list(fun gleam@dynamic:dynamic/1))(_pipe@1) + end, + Expected_as_string = begin + _pipe@2 = Expected, + gleam@dynamic:string(_pipe@2) + end, + Got_as_string = begin + _pipe@3 = Got, + gleam@dynamic:string(_pipe@3) + end, + case {Expected_as_list, Got_as_list, Expected_as_string, Got_as_string} of + {{ok, Expected_list}, {ok, Got_list}, _, _} -> + Comparison = begin + _pipe@4 = gap:compare_lists(Expected_list, Got_list), + _pipe@5 = gap@styling:from_comparison(_pipe@4), + _pipe@6 = gap@styling:highlight( + _pipe@5, + fun showtime@internal@reports@styles:expected_highlight/1, + fun showtime@internal@reports@styles:got_highlight/1, + fun(Item) -> Item end + ), + gap@styling:to_styled_comparison(_pipe@6) + end, + {erlang:element(2, Comparison), erlang:element(3, Comparison)}; + + {_, _, {ok, Expected_string}, {ok, Got_string}} -> + Comparison@1 = begin + _pipe@7 = gap:compare_strings(Expected_string, Got_string), + _pipe@8 = gap@styling:from_comparison(_pipe@7), + _pipe@9 = gap@styling:highlight( + _pipe@8, + fun showtime@internal@reports@styles:expected_highlight/1, + fun showtime@internal@reports@styles:got_highlight/1, + fun(Item@1) -> Item@1 end + ), + gap@styling:to_styled_comparison(_pipe@9) + end, + {erlang:element(2, Comparison@1), erlang:element(3, Comparison@1)}; + + {_, _, _, _} -> + {showtime@internal@reports@styles:expected_highlight( + gleam@string:inspect(Expected) + ), + showtime@internal@reports@styles:got_highlight( + gleam@string:inspect(Got) + )} + end. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.cache Binary files differnew file mode 100644 index 0000000..58b0250 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.cache_meta Binary files differnew file mode 100644 index 0000000..86e3c59 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.erl new file mode 100644 index 0000000..4022bed --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@formatter.erl @@ -0,0 +1,749 @@ +-module(showtime@internal@reports@formatter). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([create_test_report/1]). +-export_type([glee_unit_assertion_type/0, module_and_test/0, unified_error/0]). + +-type glee_unit_assertion_type() :: {glee_unit_assert_equal, binary()} | + {glee_unit_assert_not_equal, binary()} | + {glee_unit_assert_match, binary()}. + +-type module_and_test() :: {module_and_test_run, + binary(), + showtime@internal@common@test_suite:test_run()}. + +-type unified_error() :: {unified_error, + gleam@option:option(showtime@tests@meta:meta()), + binary(), + binary(), + binary(), + binary(), + gleam@option:option(integer()), + list(showtime@internal@common@test_result:trace())}. + +-spec erlang_error_to_unified( + list(showtime@internal@common@test_result:reason_detail()), + glee_unit_assertion_type(), + list(showtime@internal@common@test_result:trace()) +) -> unified_error(). +erlang_error_to_unified(Error_details, Assertion_type, Stacktrace) -> + _pipe = Error_details, + gleam@list:fold( + _pipe, + {unified_error, + none, + <<"not_set"/utf8>>, + erlang:element(2, Assertion_type), + <<""/utf8>>, + <<""/utf8>>, + none, + Stacktrace}, + fun(Unified, Reason) -> case Reason of + {expression, Expression} -> + erlang:setelement(3, Unified, Expression); + + {expected, Value} -> + case Assertion_type of + {glee_unit_assert_equal, _} -> + erlang:setelement( + 5, + Unified, + showtime@internal@reports@styles:expected_highlight( + gleam@string:inspect(Value) + ) + ); + + _ -> + Unified + end; + + {value, Value@1} -> + case Assertion_type of + {glee_unit_assert_not_equal, _} -> + erlang:setelement( + 6, + erlang:setelement( + 5, + Unified, + <<(showtime@internal@reports@styles:not_style( + <<"not "/utf8>> + ))/binary, + (gleam@string:inspect(Value@1))/binary>> + ), + showtime@internal@reports@styles:got_highlight( + gleam@string:inspect(Value@1) + ) + ); + + _ -> + erlang:setelement( + 6, + Unified, + showtime@internal@reports@styles:got_highlight( + gleam@string:inspect(Value@1) + ) + ) + end; + + {pattern, Pattern} -> + case Pattern of + <<"{ ok , _ }"/utf8>> -> + erlang:setelement( + 5, + Unified, + showtime@internal@reports@styles:expected_highlight( + <<"Ok(_)"/utf8>> + ) + ); + + <<"{ error , _ }"/utf8>> -> + erlang:setelement( + 5, + Unified, + showtime@internal@reports@styles:expected_highlight( + <<"Error(_)"/utf8>> + ) + ); + + _ -> + Unified + end; + + _ -> + Unified + end end + ). + +-spec gleam_error_to_unified( + showtime@internal@common@test_result:gleam_error_detail(), + list(showtime@internal@common@test_result:trace()) +) -> unified_error(). +gleam_error_to_unified(Gleam_error, Stacktrace) -> + case Gleam_error of + {let_assert, _, _, _, _, Value} -> + Result = gleam@dynamic:unsafe_coerce(Value), + {error, Assertion} = case Result of + {error, _} -> Result; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"showtime/internal/reports/formatter"/utf8>>, + function => <<"gleam_error_to_unified"/utf8>>, + line => 293}) + end, + case Assertion of + {eq, Got, Expected, Meta} -> + {Expected@1, Got@1} = showtime@internal@reports@compare:compare( + Expected, + Got + ), + {unified_error, + Meta, + <<"assert"/utf8>>, + <<"Assert equal"/utf8>>, + Expected@1, + Got@1, + none, + Stacktrace}; + + {not_eq, Got@2, Expected@2, Meta@1} -> + {unified_error, + Meta@1, + <<"assert"/utf8>>, + <<"Assert not equal"/utf8>>, + <<(showtime@internal@reports@styles:not_style( + <<"not "/utf8>> + ))/binary, + (gleam@string:inspect(Expected@2))/binary>>, + gleam@string:inspect(Got@2), + none, + Stacktrace}; + + {is_ok, Got@3, Meta@2} -> + {unified_error, + Meta@2, + <<"assert"/utf8>>, + <<"Assert is Ok"/utf8>>, + showtime@internal@reports@styles:expected_highlight( + <<"Ok(_)"/utf8>> + ), + showtime@internal@reports@styles:got_highlight( + gleam@string:inspect(Got@3) + ), + none, + Stacktrace}; + + {is_error, Got@4, Meta@3} -> + {unified_error, + Meta@3, + <<"assert"/utf8>>, + <<"Assert is Ok"/utf8>>, + showtime@internal@reports@styles:expected_highlight( + <<"Error(_)"/utf8>> + ), + showtime@internal@reports@styles:got_highlight( + gleam@string:inspect(Got@4) + ), + none, + Stacktrace}; + + {fail, Meta@4} -> + {unified_error, + Meta@4, + <<"assert"/utf8>>, + <<"Assert is Ok"/utf8>>, + showtime@internal@reports@styles:got_highlight( + <<"should.fail()"/utf8>> + ), + showtime@internal@reports@styles:got_highlight( + <<"N/A - test always expected to fail"/utf8>> + ), + none, + Stacktrace} + end + end. + +-spec format_reason(unified_error(), binary(), binary(), list(binary())) -> list(list(showtime@internal@reports@table:col())). +format_reason(Error, Module, Function, Output_buffer) -> + Meta@1 = case erlang:element(2, Error) of + {some, Meta} -> + {some, + [{align_right, + {styled_content, + showtime@internal@reports@styles:heading_style( + <<"Description"/utf8>> + )}, + 2}, + {separator, <<": "/utf8>>}, + {align_left, {content, erlang:element(2, Meta)}, 0}]}; + + none -> + none + end, + Stacktrace = begin + _pipe = erlang:element(8, Error), + gleam@list:map(_pipe, fun(Trace) -> case Trace of + {trace, Function@1, _, _} when Function@1 =:= <<""/utf8>> -> + <<"(anonymous)"/utf8>>; + + {trace_module, Module@1, Function@2, _, _} when Function@2 =:= <<""/utf8>> -> + <<<<Module@1/binary, "."/utf8>>/binary, + "(anonymous)"/utf8>>; + + {trace, Function@3, _, _} -> + Function@3; + + {trace_module, Module@2, Function@4, _, _} -> + <<<<Module@2/binary, "."/utf8>>/binary, + Function@4/binary>> + end end) + end, + Stacktrace_rows = case Stacktrace of + [] -> + []; + + [First | Rest] -> + First_row = {some, + [{align_right, + {styled_content, + showtime@internal@reports@styles:heading_style( + <<"Stacktrace"/utf8>> + )}, + 2}, + {separator, <<": "/utf8>>}, + {align_left, + {styled_content, + showtime@internal@reports@styles:stacktrace_style( + First + )}, + 0}]}, + Rest_rows = begin + _pipe@1 = Rest, + gleam@list:map( + _pipe@1, + fun(Row) -> + {some, + [{align_right, {content, <<""/utf8>>}, 2}, + {separator, <<" "/utf8>>}, + {align_left, + {styled_content, + showtime@internal@reports@styles:stacktrace_style( + Row + )}, + 0}]} + end + ) + end, + [First_row | Rest_rows] + end, + Output_rows = case begin + _pipe@2 = Output_buffer, + _pipe@3 = gleam@list:reverse(_pipe@2), + gleam@list:map( + _pipe@3, + fun(Row@1) -> gleam@string:trim_right(Row@1) end + ) + end of + [] -> + []; + + [First@1 | Rest@1] -> + First_row@1 = {some, + [{align_right, + {styled_content, + showtime@internal@reports@styles:heading_style( + <<"Output"/utf8>> + )}, + 2}, + {separator, <<": "/utf8>>}, + {align_left_overflow, + {styled_content, + showtime@internal@reports@styles:stacktrace_style( + First@1 + )}, + 0}]}, + Rest_rows@1 = begin + _pipe@4 = Rest@1, + gleam@list:map( + _pipe@4, + fun(Row@2) -> + {some, + [{align_right, {content, <<""/utf8>>}, 2}, + {separator, <<" "/utf8>>}, + {align_left_overflow, + {styled_content, + showtime@internal@reports@styles:stacktrace_style( + Row@2 + )}, + 0}]} + end + ) + end, + [First_row@1 | Rest_rows@1] + end, + Line@1 = begin + _pipe@5 = erlang:element(7, Error), + _pipe@6 = gleam@option:map( + _pipe@5, + fun(Line) -> <<":"/utf8, (gleam@int:to_string(Line))/binary>> end + ), + gleam@option:unwrap(_pipe@6, <<""/utf8>>) + end, + Arrow = <<(gleam@string:join( + gleam@list:repeat( + <<"-"/utf8>>, + (gleam@string:length(Module) + 1) + ((gleam@string:length( + Function + ) + + gleam@string:length(Line@1)) + div 2) + ), + <<""/utf8>> + ))/binary, + "⌄"/utf8>>, + Standard_table_rows = [{some, + [{align_right, + {styled_content, + showtime@internal@reports@styles:error_style( + <<"Failed"/utf8>> + )}, + 2}, + {separator, <<": "/utf8>>}, + {align_left, {content, Arrow}, 0}]}, + {some, + [{align_right, + {styled_content, + showtime@internal@reports@styles:heading_style( + <<"Test"/utf8>> + )}, + 2}, + {separator, <<": "/utf8>>}, + {align_left, + {styled_content, + <<<<Module/binary, "."/utf8>>/binary, + (showtime@internal@reports@styles:function_style( + <<Function/binary, Line@1/binary>> + ))/binary>>}, + 0}]}, + Meta@1, + {some, + [{align_right, + {styled_content, + showtime@internal@reports@styles:heading_style( + <<"Expected"/utf8>> + )}, + 2}, + {separator, <<": "/utf8>>}, + {align_left_overflow, + {styled_content, erlang:element(5, Error)}, + 0}]}, + {some, + [{align_right, + {styled_content, + showtime@internal@reports@styles:heading_style( + <<"Got"/utf8>> + )}, + 2}, + {separator, <<": "/utf8>>}, + {align_left_overflow, + {styled_content, erlang:element(6, Error)}, + 0}]}], + _pipe@7 = Standard_table_rows, + _pipe@8 = gleam@list:append(_pipe@7, Stacktrace_rows), + _pipe@9 = gleam@list:append(_pipe@8, Output_rows), + _pipe@10 = gleam@list:append( + _pipe@9, + [{some, + [{align_right, {content, <<""/utf8>>}, 0}, + {align_right, {content, <<""/utf8>>}, 0}, + {align_right, {content, <<""/utf8>>}, 0}]}] + ), + gleam@list:filter_map( + _pipe@10, + fun(Row@3) -> gleam@option:to_result(Row@3, nil) end + ). + +-spec create_test_report( + gleam@dict:dict(binary(), gleam@dict:dict(binary(), showtime@internal@common@test_suite:test_run())) +) -> {binary(), integer()}. +create_test_report(Test_results) -> + All_test_runs = begin + _pipe = Test_results, + _pipe@1 = gleam@map:values(_pipe), + gleam@list:flat_map(_pipe@1, fun gleam@map:values/1) + end, + Failed_test_runs = begin + _pipe@2 = Test_results, + _pipe@3 = gleam@map:to_list(_pipe@2), + gleam@list:flat_map( + _pipe@3, + fun(Entry) -> + {Module_name, Test_module_results} = Entry, + _pipe@4 = Test_module_results, + _pipe@5 = gleam@map:values(_pipe@4), + gleam@list:filter_map(_pipe@5, fun(Test_run) -> case Test_run of + {completed_test_run, _, _, Result} -> + case Result of + {error, _} -> + {ok, + {module_and_test_run, + Module_name, + Test_run}}; + + {ok, {ignored, _}} -> + {error, nil}; + + {ok, _} -> + {error, nil} + end; + + _ -> + _pipe@6 = Test_run, + gleam@io:debug(_pipe@6), + {error, nil} + end end) + end + ) + end, + Ignored_test_runs = begin + _pipe@7 = Test_results, + _pipe@8 = gleam@map:to_list(_pipe@7), + gleam@list:flat_map( + _pipe@8, + fun(Entry@1) -> + {Module_name@1, Test_module_results@1} = Entry@1, + _pipe@9 = Test_module_results@1, + _pipe@10 = gleam@map:values(_pipe@9), + gleam@list:filter_map( + _pipe@10, + fun(Test_run@1) -> case Test_run@1 of + {completed_test_run, Test_function, _, Result@1} -> + case Result@1 of + {ok, {ignored, Reason}} -> + {ok, + {<<<<Module_name@1/binary, + "."/utf8>>/binary, + (erlang:element( + 2, + Test_function + ))/binary>>, + Reason}}; + + _ -> + {error, nil} + end; + + _ -> + {error, nil} + end end + ) + end + ) + end, + Failed_tests_report = begin + _pipe@11 = Failed_test_runs, + _pipe@12 = gleam@list:filter_map( + _pipe@11, + fun(Module_and_test_run) -> + case erlang:element(3, Module_and_test_run) of + {completed_test_run, Test_function@1, _, Result@2} -> + case Result@2 of + {error, Exception} -> + case erlang:element(3, Exception) of + {assert_equal, Reason_details} -> + {ok, + format_reason( + erlang_error_to_unified( + Reason_details, + {glee_unit_assert_equal, + <<"Assert equal"/utf8>>}, + erlang:element( + 2, + erlang:element( + 4, + Exception + ) + ) + ), + erlang:element( + 2, + Module_and_test_run + ), + erlang:element( + 2, + Test_function@1 + ), + erlang:element(5, Exception) + )}; + + {assert_not_equal, Reason_details@1} -> + {ok, + format_reason( + erlang_error_to_unified( + Reason_details@1, + {glee_unit_assert_not_equal, + <<"Assert not equal"/utf8>>}, + erlang:element( + 2, + erlang:element( + 4, + Exception + ) + ) + ), + erlang:element( + 2, + Module_and_test_run + ), + erlang:element( + 2, + Test_function@1 + ), + erlang:element(5, Exception) + )}; + + {assert_match, Reason_details@2} -> + {ok, + format_reason( + erlang_error_to_unified( + Reason_details@2, + {glee_unit_assert_match, + <<"Assert match"/utf8>>}, + erlang:element( + 2, + erlang:element( + 4, + Exception + ) + ) + ), + erlang:element( + 2, + Module_and_test_run + ), + erlang:element( + 2, + Test_function@1 + ), + erlang:element(5, Exception) + )}; + + {gleam_error, Reason@1} -> + {ok, + format_reason( + gleam_error_to_unified( + Reason@1, + erlang:element( + 2, + erlang:element( + 4, + Exception + ) + ) + ), + erlang:element( + 2, + Module_and_test_run + ), + erlang:element( + 2, + Test_function@1 + ), + erlang:element(5, Exception) + )}; + + {gleam_assert, Value, Line_no} -> + {ok, + format_reason( + {unified_error, + none, + <<"gleam assert"/utf8>>, + <<"Assert failed"/utf8>>, + <<"Patterns should match"/utf8>>, + showtime@internal@reports@styles:error_style( + gleam@string:inspect( + Value + ) + ), + {some, Line_no}, + erlang:element( + 2, + erlang:element( + 4, + Exception + ) + )}, + erlang:element( + 2, + Module_and_test_run + ), + erlang:element( + 2, + Test_function@1 + ), + erlang:element(5, Exception) + )}; + + {generic_exception, Value@1} -> + {ok, + format_reason( + {unified_error, + none, + <<"generic exception"/utf8>>, + <<"Test function threw an exception"/utf8>>, + <<"Exception in test function"/utf8>>, + showtime@internal@reports@styles:error_style( + gleam@string:inspect( + Value@1 + ) + ), + none, + erlang:element( + 2, + erlang:element( + 4, + Exception + ) + )}, + erlang:element( + 2, + Module_and_test_run + ), + erlang:element( + 2, + Test_function@1 + ), + erlang:element(5, Exception) + )}; + + Other -> + gleam@io:println( + <<"Other: "/utf8, + (gleam@string:inspect(Other))/binary>> + ), + erlang:error(#{gleam_error => panic, + message => <<"panic expression evaluated"/utf8>>, + module => <<"showtime/internal/reports/formatter"/utf8>>, + function => <<"create_test_report"/utf8>>, + line => 178}), + {error, nil} + end; + + _ -> + {error, nil} + end; + + _ -> + {error, nil} + end + end + ), + gleam@list:fold( + _pipe@12, + [], + fun(Rows, Test_rows) -> gleam@list:append(Rows, Test_rows) end + ) + end, + All_test_execution_time_reports = begin + _pipe@13 = All_test_runs, + gleam@list:filter_map(_pipe@13, fun(Test_run@2) -> case Test_run@2 of + {completed_test_run, Test_function@2, Total_time, _} -> + {ok, + <<<<<<(erlang:element(2, Test_function@2))/binary, + ": "/utf8>>/binary, + (gleam@int:to_string(Total_time))/binary>>/binary, + " ms"/utf8>>}; + + _ -> + {error, nil} + end end) + end, + _ = begin + _pipe@14 = All_test_execution_time_reports, + gleam@string:join(_pipe@14, <<"\n"/utf8>>) + end, + All_tests_count = begin + _pipe@15 = All_test_runs, + gleam@list:length(_pipe@15) + end, + Ignored_tests_count = begin + _pipe@16 = Ignored_test_runs, + gleam@list:length(_pipe@16) + end, + Failed_tests_count = begin + _pipe@17 = Failed_test_runs, + gleam@list:length(_pipe@17) + end, + Passed = showtime@internal@reports@styles:passed_style( + <<(gleam@int:to_string( + (All_tests_count - Failed_tests_count) - Ignored_tests_count + ))/binary, + " passed"/utf8>> + ), + Failed = showtime@internal@reports@styles:failed_style( + <<(gleam@int:to_string(Failed_tests_count))/binary, " failed"/utf8>> + ), + Ignored = case Ignored_tests_count of + 0 -> + <<""/utf8>>; + + _ -> + <<", "/utf8, + (showtime@internal@reports@styles:ignored_style( + <<(gleam@int:to_string(Ignored_tests_count))/binary, + " ignored"/utf8>> + ))/binary>> + end, + Failed_tests_table = begin + _pipe@18 = {table, none, Failed_tests_report}, + _pipe@19 = showtime@internal@reports@table:align_table(_pipe@18), + showtime@internal@reports@table:to_string(_pipe@19) + end, + Test_report = <<<<<<<<<<<<"\n"/utf8, Failed_tests_table/binary>>/binary, + "\n"/utf8>>/binary, + Passed/binary>>/binary, + ", "/utf8>>/binary, + Failed/binary>>/binary, + Ignored/binary>>, + {Test_report, Failed_tests_count}. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.cache Binary files differnew file mode 100644 index 0000000..7dd3121 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.cache_meta Binary files differnew file mode 100644 index 0000000..c0078b3 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.erl new file mode 100644 index 0000000..ec6230c --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@styles.erl @@ -0,0 +1,93 @@ +-module(showtime@internal@reports@styles). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([not_style/1, module_style/1, heading_style/1, stacktrace_style/1, failed_style/1, error_style/1, got_highlight/1, passed_style/1, expected_highlight/1, ignored_style/1, function_style/1, strip_style/1]). + +-spec not_style(binary()) -> binary(). +not_style(Text) -> + gleam_community@ansi:bold(Text). + +-spec module_style(binary()) -> binary(). +module_style(Text) -> + gleam_community@ansi:cyan(Text). + +-spec heading_style(binary()) -> binary(). +heading_style(Text) -> + gleam_community@ansi:cyan(Text). + +-spec stacktrace_style(binary()) -> binary(). +stacktrace_style(Text) -> + Text. + +-spec bold_red(binary()) -> binary(). +bold_red(Text) -> + gleam_community@ansi:bold(gleam_community@ansi:red(Text)). + +-spec failed_style(binary()) -> binary(). +failed_style(Text) -> + bold_red(Text). + +-spec error_style(binary()) -> binary(). +error_style(Text) -> + bold_red(Text). + +-spec got_highlight(binary()) -> binary(). +got_highlight(Text) -> + bold_red(Text). + +-spec bold_green(binary()) -> binary(). +bold_green(Text) -> + gleam_community@ansi:bold(gleam_community@ansi:green(Text)). + +-spec passed_style(binary()) -> binary(). +passed_style(Text) -> + bold_green(Text). + +-spec expected_highlight(binary()) -> binary(). +expected_highlight(Text) -> + bold_green(Text). + +-spec bold_yellow(binary()) -> binary(). +bold_yellow(Text) -> + gleam_community@ansi:bold(gleam_community@ansi:yellow(Text)). + +-spec ignored_style(binary()) -> binary(). +ignored_style(Text) -> + bold_yellow(Text). + +-spec bold_cyan(binary()) -> binary(). +bold_cyan(Text) -> + gleam_community@ansi:bold(gleam_community@ansi:cyan(Text)). + +-spec function_style(binary()) -> binary(). +function_style(Text) -> + bold_cyan(Text). + +-spec strip_style(binary()) -> binary(). +strip_style(Text) -> + {New_text, _} = begin + _pipe = Text, + _pipe@1 = gleam@string:to_graphemes(_pipe), + gleam@list:fold( + _pipe@1, + {<<""/utf8>>, false}, + fun(Acc, Char) -> + {Str, Removing} = Acc, + Bit_char = gleam_stdlib:identity(Char), + case {Bit_char, Removing} of + {<<16#1b>>, _} -> + {Str, true}; + + {<<16#6d>>, true} -> + {Str, false}; + + {_, true} -> + {Str, true}; + + {_, false} -> + {<<Str/binary, Char/binary>>, false} + end + end + ) + end, + New_text. diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.cache Binary files differnew file mode 100644 index 0000000..61c532d --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.cache_meta Binary files differnew file mode 100644 index 0000000..080524c --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.erl new file mode 100644 index 0000000..35dbba3 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@internal@reports@table.erl @@ -0,0 +1,229 @@ +-module(showtime@internal@reports@table). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([to_string/1, align_table/1]). +-export_type([content/0, col/0, table/0]). + +-type content() :: {content, binary()} | {styled_content, binary()}. + +-type col() :: {align_right, content(), integer()} | + {align_left, content(), integer()} | + {align_right_overflow, content(), integer()} | + {align_left_overflow, content(), integer()} | + {separator, binary()} | + {aligned, binary()}. + +-type table() :: {table, gleam@option:option(binary()), list(list(col()))}. + +-spec to_string(table()) -> binary(). +to_string(Table) -> + Rows = begin + _pipe = erlang:element(3, Table), + _pipe@3 = gleam@list:map(_pipe, fun(Row) -> _pipe@1 = Row, + _pipe@2 = gleam@list:filter_map(_pipe@1, fun(Col) -> case Col of + {separator, Char} -> + {ok, Char}; + + {aligned, Content} -> + {ok, Content}; + + _ -> + {error, nil} + end end), + gleam@string:join(_pipe@2, <<""/utf8>>) end), + gleam@string:join(_pipe@3, <<"\n"/utf8>>) + end, + Header@1 = begin + _pipe@4 = erlang:element(2, Table), + _pipe@5 = gleam@option:map( + _pipe@4, + fun(Header) -> <<Header/binary, "\n"/utf8>> end + ), + gleam@option:unwrap(_pipe@5, <<""/utf8>>) + end, + <<Header@1/binary, Rows/binary>>. + +-spec pad_left(binary(), integer(), binary()) -> binary(). +pad_left(Str, Num, Char) -> + Padding = begin + _pipe = gleam@list:repeat(Char, Num), + gleam@string:join(_pipe, <<""/utf8>>) + end, + <<Padding/binary, Str/binary>>. + +-spec pad_right(binary(), integer(), binary()) -> binary(). +pad_right(Str, Num, Char) -> + Padding = begin + _pipe = gleam@list:repeat(Char, Num), + gleam@string:join(_pipe, <<""/utf8>>) + end, + <<Str/binary, Padding/binary>>. + +-spec align_table(table()) -> table(). +align_table(Table) -> + Cols = begin + _pipe = erlang:element(3, Table), + gleam@list:transpose(_pipe) + end, + Col_width = begin + _pipe@1 = Cols, + gleam@list:map(_pipe@1, fun(Col) -> _pipe@2 = Col, + _pipe@3 = gleam@list:map( + _pipe@2, + fun(Content) -> case Content of + {align_right, {content, Unstyled}, _} -> + Unstyled; + + {align_right, {styled_content, Styled}, _} -> + showtime@internal@reports@styles:strip_style( + Styled + ); + + {align_left, {content, Unstyled@1}, _} -> + Unstyled@1; + + {align_left, {styled_content, Styled@1}, _} -> + showtime@internal@reports@styles:strip_style( + Styled@1 + ); + + {align_left_overflow, _, _} -> + <<""/utf8>>; + + {align_right_overflow, _, _} -> + <<""/utf8>>; + + {separator, Char} -> + Char; + + {aligned, Content@1} -> + Content@1 + end end + ), + gleam@list:fold( + _pipe@3, + 0, + fun(Max, Str) -> + gleam@int:max(Max, gleam@string:length(Str)) + end + ) end) + end, + Aligned_col = begin + _pipe@4 = Cols, + _pipe@5 = gleam@list:zip(_pipe@4, Col_width), + gleam@list:map( + _pipe@5, + fun(Col_and_width) -> + {Col@1, Width} = Col_and_width, + _pipe@6 = Col@1, + gleam@list:map(_pipe@6, fun(Content@2) -> case Content@2 of + {align_right, {content, Unstyled@2}, Margin} -> + {aligned, + pad_left( + Unstyled@2, + (Width + Margin) - gleam@string:length( + Unstyled@2 + ), + <<" "/utf8>> + )}; + + {align_right, {styled_content, Styled@2}, Margin@1} -> + {aligned, + pad_left( + Styled@2, + (Width + Margin@1) - gleam@string:length( + showtime@internal@reports@styles:strip_style( + Styled@2 + ) + ), + <<" "/utf8>> + )}; + + {align_right_overflow, + {content, Unstyled@3}, + Margin@2} -> + {aligned, + pad_left( + Unstyled@3, + (Width + Margin@2) - gleam@string:length( + Unstyled@3 + ), + <<" "/utf8>> + )}; + + {align_right_overflow, + {styled_content, Styled@3}, + Margin@3} -> + {aligned, + pad_left( + Styled@3, + (Width + Margin@3) - gleam@string:length( + showtime@internal@reports@styles:strip_style( + Styled@3 + ) + ), + <<" "/utf8>> + )}; + + {align_left, {content, Unstyled@4}, Margin@4} -> + {aligned, + pad_right( + Unstyled@4, + (Width + Margin@4) - gleam@string:length( + Unstyled@4 + ), + <<" "/utf8>> + )}; + + {align_left, {styled_content, Styled@4}, Margin@5} -> + {aligned, + pad_right( + Styled@4, + (Width + Margin@5) - gleam@string:length( + showtime@internal@reports@styles:strip_style( + Styled@4 + ) + ), + <<" "/utf8>> + )}; + + {align_left_overflow, + {content, Unstyled@5}, + Margin@6} -> + {aligned, + pad_right( + Unstyled@5, + (Width + Margin@6) - gleam@string:length( + Unstyled@5 + ), + <<" "/utf8>> + )}; + + {align_left_overflow, + {styled_content, Styled@5}, + Margin@7} -> + {aligned, + pad_right( + Styled@5, + (Width + Margin@7) - gleam@string:length( + showtime@internal@reports@styles:strip_style( + Styled@5 + ) + ), + <<" "/utf8>> + )}; + + {separator, Char@1} -> + {separator, Char@1}; + + {aligned, Content@3} -> + {aligned, Content@3} + end end) + end + ) + end, + Aligned_rows = begin + _pipe@7 = Aligned_col, + gleam@list:transpose(_pipe@7) + end, + erlang:setelement(3, Table, Aligned_rows). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.cache Binary files differnew file mode 100644 index 0000000..4aa8df1 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.cache_meta Binary files differnew file mode 100644 index 0000000..7f1bdda --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.erl new file mode 100644 index 0000000..c975467 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@meta.erl @@ -0,0 +1,8 @@ +-module(showtime@tests@meta). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export_type([meta/0]). + +-type meta() :: {meta, binary(), list(binary())}. + + diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.cache Binary files differnew file mode 100644 index 0000000..90d3838 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.cache_meta Binary files differnew file mode 100644 index 0000000..fcc4e8a --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.erl new file mode 100644 index 0000000..05bea8f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@should.erl @@ -0,0 +1,143 @@ +-module(showtime@tests@should). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([evaluate/1, equal/2, equal_meta/3, not_equal/2, not_equal_meta/3, be_ok/1, be_ok_meta/2, be_error/1, be_error_meta/2, fail/0, fail_meta/1, be_true/1, be_true_meta/2, be_false/1, be_false_meta/2]). +-export_type([assertion/2]). + +-type assertion(MXN, MXO) :: {eq, + MXN, + MXN, + gleam@option:option(showtime@tests@meta:meta())} | + {not_eq, MXN, MXN, gleam@option:option(showtime@tests@meta:meta())} | + {is_ok, + {ok, MXN} | {error, MXO}, + gleam@option:option(showtime@tests@meta:meta())} | + {is_error, + {ok, MXN} | {error, MXO}, + gleam@option:option(showtime@tests@meta:meta())} | + {fail, gleam@option:option(showtime@tests@meta:meta())}. + +-spec evaluate(assertion(any(), any())) -> nil. +evaluate(Assertion) -> + case Assertion of + {eq, A, B, _} -> + case A =:= B of + true -> + nil; + + false -> + showtime_ffi:gleam_error({error, Assertion}) + end; + + {not_eq, A@1, B@1, _} -> + case A@1 /= B@1 of + true -> + nil; + + false -> + showtime_ffi:gleam_error({error, Assertion}) + end; + + {is_ok, A@2, _} -> + case A@2 of + {ok, _} -> + nil; + + {error, _} -> + showtime_ffi:gleam_error({error, Assertion}) + end; + + {is_error, A@3, _} -> + case A@3 of + {error, _} -> + nil; + + {ok, _} -> + showtime_ffi:gleam_error({error, Assertion}) + end; + + {fail, _} -> + showtime_ffi:gleam_error({error, Assertion}) + end. + +-spec equal(MXP, MXP) -> nil. +equal(A, B) -> + evaluate({eq, A, B, none}). + +-spec equal_meta(MXR, MXR, showtime@tests@meta:meta()) -> nil. +equal_meta(A, B, Meta) -> + evaluate({eq, A, B, {some, Meta}}). + +-spec not_equal(MXT, MXT) -> nil. +not_equal(A, B) -> + evaluate({not_eq, A, B, none}). + +-spec not_equal_meta(MXV, MXV, showtime@tests@meta:meta()) -> nil. +not_equal_meta(A, B, Meta) -> + evaluate({not_eq, A, B, {some, Meta}}). + +-spec be_ok({ok, MXX} | {error, any()}) -> MXX. +be_ok(A) -> + evaluate({is_ok, A, none}), + {ok, Value} = case A of + {ok, _} -> A; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"showtime/tests/should"/utf8>>, + function => <<"be_ok"/utf8>>, + line => 30}) + end, + Value. + +-spec be_ok_meta({ok, any()} | {error, any()}, showtime@tests@meta:meta()) -> nil. +be_ok_meta(A, Meta) -> + evaluate({is_ok, A, {some, Meta}}). + +-spec be_error({ok, any()} | {error, MYI}) -> MYI. +be_error(A) -> + evaluate({is_error, A, none}), + {error, Value} = case A of + {error, _} -> A; + _assert_fail -> + erlang:error(#{gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => _assert_fail, + module => <<"showtime/tests/should"/utf8>>, + function => <<"be_error"/utf8>>, + line => 40}) + end, + Value. + +-spec be_error_meta({ok, any()} | {error, any()}, showtime@tests@meta:meta()) -> nil. +be_error_meta(A, Meta) -> + evaluate({is_error, A, {some, Meta}}). + +-spec fail() -> nil. +fail() -> + evaluate({fail, none}). + +-spec fail_meta(showtime@tests@meta:meta()) -> nil. +fail_meta(Meta) -> + evaluate({fail, {some, Meta}}). + +-spec be_true(boolean()) -> nil. +be_true(A) -> + _pipe = A, + equal(_pipe, true). + +-spec be_true_meta(boolean(), showtime@tests@meta:meta()) -> nil. +be_true_meta(A, Meta) -> + _pipe = A, + equal_meta(_pipe, true, Meta). + +-spec be_false(boolean()) -> nil. +be_false(A) -> + _pipe = A, + equal(_pipe, false). + +-spec be_false_meta(boolean(), showtime@tests@meta:meta()) -> nil. +be_false_meta(A, Meta) -> + _pipe = A, + equal_meta(_pipe, false, Meta). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.cache b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.cache Binary files differnew file mode 100644 index 0000000..d07ea1b --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.cache diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.cache_meta b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.cache_meta Binary files differnew file mode 100644 index 0000000..8354c6f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.cache_meta diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.erl new file mode 100644 index 0000000..2f65614 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime@tests@test.erl @@ -0,0 +1,57 @@ +-module(showtime@tests@test). +-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). + +-export([test/2, equal/3, not_equal/3, with_meta/2, be_ok/2, be_error/2, fail/1, be_true/2, be_false/2]). +-export_type([test/0, meta_should/1]). + +-type test() :: {test, showtime@tests@meta:meta(), fun(() -> nil)}. + +-type meta_should(OKH) :: {meta_should, + fun((OKH, OKH) -> nil), + fun((OKH, OKH) -> nil)}. + +-spec test(showtime@tests@meta:meta(), fun((showtime@tests@meta:meta()) -> nil)) -> test(). +test(Meta, Test_function) -> + {test, Meta, fun() -> Test_function(Meta) end}. + +-spec equal(OKM, OKM, showtime@tests@meta:meta()) -> nil. +equal(A, B, Meta) -> + gleam@io:debug(A), + gleam@io:debug(B), + showtime@tests@should:equal_meta(A, B, Meta). + +-spec not_equal(OKO, OKO, showtime@tests@meta:meta()) -> nil. +not_equal(A, B, Meta) -> + showtime@tests@should:equal_meta(A, B, Meta). + +-spec with_meta(showtime@tests@meta:meta(), fun((meta_should(any())) -> nil)) -> test(). +with_meta(Meta, Test_function) -> + {test, + Meta, + fun() -> + Test_function( + {meta_should, + fun(A, B) -> equal(A, B, Meta) end, + fun(A@1, B@1) -> not_equal(A@1, B@1, Meta) end} + ) + end}. + +-spec be_ok({ok, any()} | {error, any()}, showtime@tests@meta:meta()) -> nil. +be_ok(A, Meta) -> + showtime@tests@should:be_ok_meta(A, Meta). + +-spec be_error({ok, any()} | {error, any()}, showtime@tests@meta:meta()) -> nil. +be_error(A, Meta) -> + showtime@tests@should:be_error_meta(A, Meta). + +-spec fail(showtime@tests@meta:meta()) -> nil. +fail(Meta) -> + showtime@tests@should:fail_meta(Meta). + +-spec be_true(boolean(), showtime@tests@meta:meta()) -> nil. +be_true(A, Meta) -> + showtime@tests@should:be_true_meta(A, Meta). + +-spec be_false(boolean(), showtime@tests@meta:meta()) -> nil. +be_false(A, Meta) -> + showtime@tests@should:be_false_meta(A, Meta). diff --git a/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime_ffi.erl b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime_ffi.erl new file mode 100644 index 0000000..3259623 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/_gleam_artefacts/showtime_ffi.erl @@ -0,0 +1,187 @@ +-module(showtime_ffi). + +-export([run_test/4, functions/0, capture_output/1, gleam_error/1]). + +gleam_error(Value) -> + erlang:error(#{ + gleam_error => let_assert, + message => <<"Assertion pattern match failed"/utf8>>, + value => Value, + module => <<"this/is/not/used"/utf8>>, + function => <<"gleam_error"/utf8>>, + % Not used + line => 0 + }). + +start_output_capture(Capture) -> + OldGroupLeader = group_leader(), + CapturePid = spawn(showtime_ffi, capture_output, [{[], {OldGroupLeader, Capture}}]), + group_leader(CapturePid, self()), + {CapturePid, OldGroupLeader}. + +stop_output_capture({CapturePid, OldGroupLeader}) -> + group_leader(OldGroupLeader, self()), + CapturePid ! {capture_done, self()}, + receive + Buffer -> + Buffer + end. + +capture_output({Buffer, {OldGroupLeader, Capture}}) -> + receive + {io_request, From, ReplyAs, {put_chars, unicode, BitString}} -> + case Capture of + yes -> + From ! {io_reply, ReplyAs, ok}, + capture_output({[BitString | Buffer], {OldGroupLeader, Capture}}); + mixed -> + OldGroupLeader ! {io_request, From, ReplyAs, {put_chars, unicode, BitString}}, + capture_output({[BitString | Buffer], {OldGroupLeader, Capture}}); + no -> + OldGroupLeader ! {io_request, From, ReplyAs, {put_chars, unicode, BitString}}, + capture_output({Buffer, {OldGroupLeader, Capture}}) + end; + {capture_done, SenderPid} -> + SenderPid ! Buffer; + OtherMessage -> + OldGroupLeader ! OtherMessage, + capture_output({Buffer, {OldGroupLeader, Capture}}) + end. + +run_test(Module, Function, IgnoreTags, Capture) -> + OutputCapture = start_output_capture(Capture), + try + Result = apply(Module, Function, []), + {ResultType, FinalResult} = + case Result of + {test, {meta, _Description, Tags}, TestFun} -> + case + lists:any( + fun(Tag) -> + lists:any(fun(IgnoreTag) -> IgnoreTag == Tag end, IgnoreTags) + end, + Tags + ) + of + true -> + {ignored, ignore}; + false -> + {test_function_return, TestFun()} + end; + DirectResult -> + {test_function_return, DirectResult} + end, + OutputCaptureBuffer = stop_output_capture(OutputCapture), + case ResultType of + ignored -> {ok, {ResultType, FinalResult}}; + _ -> {ok, {ResultType, FinalResult, OutputCaptureBuffer}} + end + catch + Class:Reason:Stacktrace -> + GleamReason = + case Reason of + {Assertion, ReasonList} -> + ErlangReasonList = + lists:map( + fun(ReasonDetail) -> + case ReasonDetail of + {line, LineNo} -> + {reason_line, LineNo}; + {expression, List} -> + {expression, list_to_binary(List)}; + {module, ModuleAtom} -> + {module, atom_to_binary(ModuleAtom)}; + {pattern, Pattern} -> + {pattern, list_to_binary(Pattern)}; + Other -> + Other + end + end, + ReasonList + ), + GleamAssertionType = + case Assertion of + assertEqual -> + assert_equal; + assertNotEqual -> + assert_not_equal; + assertMatch -> + assert_match; + OtherAssertionType -> + OtherAssertionType + end, + {GleamAssertionType, ErlangReasonList}; + #{ + function := GleamFunction, + gleam_error := GleamError, + line := Line, + message := Message, + module := GleamModule, + value := Value + } -> + case Value of + {error, {OkValue, _, _, _}} when OkValue == not_eq; OkValue == eq -> + {gleam_error, + {GleamError, GleamModule, GleamFunction, Line, Message, Value}}; + {error, {OkValue, _, _}} when OkValue == is_ok; OkValue == is_error -> + {gleam_error, + {GleamError, GleamModule, GleamFunction, Line, Message, Value}}; + {error, {OkValue, _}} when OkValue == fail -> + {gleam_error, + {GleamError, GleamModule, GleamFunction, Line, Message, Value}}; + _ -> + {gleam_assert, Value, Line} + end; + OtherReason -> + {generic_exception, OtherReason} + end, + GleamClass = + case Class of + error -> + erlang_error; + Other -> + Other + end, + GleamTraceList = + lists:map( + fun(Trace) -> + case Trace of + {ModuleName, FunctionName, Arity, ExtraInfoList} -> + {trace_module, atom_to_binary(ModuleName), + atom_to_binary(FunctionName), map_arity(Arity), + map_extra_info_list(ExtraInfoList)}; + {FunctionName, Arity, ExtraInfoList} -> + {trace, atom_to_binary(FunctionName), map_arity(Arity), + map_extra_info_list(ExtraInfoList)} + end + end, + Stacktrace + ), + OutputCaptureBufferCatch = stop_output_capture(OutputCapture), + {error, + {erlang_exception, GleamClass, GleamReason, {trace_list, GleamTraceList}, + OutputCaptureBufferCatch}} + end. + +map_extra_info_list(ExtraInfoList) -> + lists:map( + fun(ExtraInfo) -> + case ExtraInfo of + {file, FileNameList} -> {file, list_to_binary(FileNameList)}; + Other -> Other + end + end, + ExtraInfoList + ). + +map_arity(Arity) -> + if + is_list(Arity) -> + {arg_list, Arity}; + is_integer(Arity) -> + {num, Arity} + end. + +functions() -> + Funs = module_info(exports), + Funs. diff --git a/aoc2023/build/dev/erlang/adglent/ebin/adglent.app b/aoc2023/build/dev/erlang/adglent/ebin/adglent.app new file mode 100644 index 0000000..f8e1aa6 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/adglent.app @@ -0,0 +1,17 @@ +{application, adglent, [ + {vsn, "1.2.0"}, + {applications, [gap, + gleam_community_ansi, + gleam_erlang, + gleam_http, + gleam_httpc, + gleam_otp, + gleam_stdlib, + glint, + simplifile, + snag, + tom]}, + {description, "Advent of code helper - automating setup of tests, solution template and problem input"}, + {modules, []}, + {registered, []} +]}. diff --git a/aoc2023/build/dev/erlang/adglent/ebin/adglent.beam b/aoc2023/build/dev/erlang/adglent/ebin/adglent.beam Binary files differnew file mode 100644 index 0000000..c53eb59 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/adglent.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/adglent@day.beam b/aoc2023/build/dev/erlang/adglent/ebin/adglent@day.beam Binary files differnew file mode 100644 index 0000000..9ad63c2 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/adglent@day.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/adglent@init.beam b/aoc2023/build/dev/erlang/adglent/ebin/adglent@init.beam Binary files differnew file mode 100644 index 0000000..37d94e6 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/adglent@init.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/adglent_ffi.beam b/aoc2023/build/dev/erlang/adglent/ebin/adglent_ffi.beam Binary files differnew file mode 100644 index 0000000..259f958 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/adglent_ffi.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@aoc_client.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@aoc_client.beam Binary files differnew file mode 100644 index 0000000..9a78e8e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@aoc_client.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@errors.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@errors.beam Binary files differnew file mode 100644 index 0000000..c97eda5 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@errors.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@prompt.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@prompt.beam Binary files differnew file mode 100644 index 0000000..50b7d68 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@prompt.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@template.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@template.beam Binary files differnew file mode 100644 index 0000000..cbe144e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@template.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@solution.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@solution.beam Binary files differnew file mode 100644 index 0000000..54c7937 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@solution.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@test_main.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@test_main.beam Binary files differnew file mode 100644 index 0000000..7e35186 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@test_main.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@testfile_gleeunit.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@testfile_gleeunit.beam Binary files differnew file mode 100644 index 0000000..7acb10e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@testfile_gleeunit.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@testfile_showtime.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@testfile_showtime.beam Binary files differnew file mode 100644 index 0000000..a77da82 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@templates@testfile_showtime.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/priv@toml.beam b/aoc2023/build/dev/erlang/adglent/ebin/priv@toml.beam Binary files differnew file mode 100644 index 0000000..1788e31 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/priv@toml.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime.beam Binary files differnew file mode 100644 index 0000000..d3a477e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@cli.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@cli.beam Binary files differnew file mode 100644 index 0000000..e9be51d --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@cli.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@common_event_handler.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@common_event_handler.beam Binary files differnew file mode 100644 index 0000000..de943fd --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@common_event_handler.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@test_result.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@test_result.beam Binary files differnew file mode 100644 index 0000000..f7b2f57 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@test_result.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@test_suite.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@test_suite.beam Binary files differnew file mode 100644 index 0000000..6146227 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@common@test_suite.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@discover.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@discover.beam Binary files differnew file mode 100644 index 0000000..4f28602 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@discover.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@event_handler.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@event_handler.beam Binary files differnew file mode 100644 index 0000000..ed9bbda --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@event_handler.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@module_handler.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@module_handler.beam Binary files differnew file mode 100644 index 0000000..75e190f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@module_handler.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@runner.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@runner.beam Binary files differnew file mode 100644 index 0000000..d0a69a6 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@erlang@runner.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@compare.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@compare.beam Binary files differnew file mode 100644 index 0000000..dc16640 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@compare.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@formatter.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@formatter.beam Binary files differnew file mode 100644 index 0000000..7d6a27a --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@formatter.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@styles.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@styles.beam Binary files differnew file mode 100644 index 0000000..3a5c720 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@styles.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@table.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@table.beam Binary files differnew file mode 100644 index 0000000..7778cd8 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@internal@reports@table.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@meta.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@meta.beam Binary files differnew file mode 100644 index 0000000..2f911da --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@meta.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@should.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@should.beam Binary files differnew file mode 100644 index 0000000..14ead72 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@should.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@test.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@test.beam Binary files differnew file mode 100644 index 0000000..f3d21e6 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime@tests@test.beam diff --git a/aoc2023/build/dev/erlang/adglent/ebin/showtime_ffi.beam b/aoc2023/build/dev/erlang/adglent/ebin/showtime_ffi.beam Binary files differnew file mode 100644 index 0000000..95c965e --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/ebin/showtime_ffi.beam diff --git a/aoc2023/build/dev/erlang/adglent/include/adglent_Example.hrl b/aoc2023/build/dev/erlang/adglent/include/adglent_Example.hrl new file mode 100644 index 0000000..615e473 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/adglent_Example.hrl @@ -0,0 +1 @@ +-record(example, {input :: binary(), answer :: any()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/priv@toml_TomGetError.hrl b/aoc2023/build/dev/erlang/adglent/include/priv@toml_TomGetError.hrl new file mode 100644 index 0000000..4cd5ddd --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/priv@toml_TomGetError.hrl @@ -0,0 +1 @@ +-record(tom_get_error, {error :: tom:get_error()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/priv@toml_TomParseError.hrl b/aoc2023/build/dev/erlang/adglent/include/priv@toml_TomParseError.hrl new file mode 100644 index 0000000..7306934 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/priv@toml_TomParseError.hrl @@ -0,0 +1 @@ +-record(tom_parse_error, {error :: tom:parse_error()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@common_event_handler_Finished.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@common_event_handler_Finished.hrl new file mode 100644 index 0000000..7d24e52 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@common_event_handler_Finished.hrl @@ -0,0 +1 @@ +-record(finished, {num_modules :: integer()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@common_event_handler_HandlerState.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@common_event_handler_HandlerState.hrl new file mode 100644 index 0000000..3efcd39 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@common_event_handler_HandlerState.hrl @@ -0,0 +1,5 @@ +-record(handler_state, { + test_state :: showtime@internal@common@common_event_handler:test_state(), + num_done :: integer(), + events :: gleam@dict:dict(binary(), gleam@dict:dict(binary(), showtime@internal@common@test_suite:test_run())) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ArgList.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ArgList.hrl new file mode 100644 index 0000000..79f34f8 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ArgList.hrl @@ -0,0 +1 @@ +-record(arg_list, {arg_list :: list(gleam@dynamic:dynamic_())}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertEqual.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertEqual.hrl new file mode 100644 index 0000000..c6458ba --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertEqual.hrl @@ -0,0 +1,3 @@ +-record(assert_equal, { + details :: list(showtime@internal@common@test_result:reason_detail()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertMatch.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertMatch.hrl new file mode 100644 index 0000000..4920304 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertMatch.hrl @@ -0,0 +1,3 @@ +-record(assert_match, { + details :: list(showtime@internal@common@test_result:reason_detail()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertNotEqual.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertNotEqual.hrl new file mode 100644 index 0000000..221c15f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_AssertNotEqual.hrl @@ -0,0 +1,3 @@ +-record(assert_not_equal, { + details :: list(showtime@internal@common@test_result:reason_detail()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ErlangException.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ErlangException.hrl new file mode 100644 index 0000000..9a31ba8 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ErlangException.hrl @@ -0,0 +1,6 @@ +-record(erlang_exception, { + class :: showtime@internal@common@test_result:class(), + reason :: showtime@internal@common@test_result:reason(), + stacktrace :: showtime@internal@common@test_result:trace_list(), + output_buffer :: list(binary()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ErrorInfo.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ErrorInfo.hrl new file mode 100644 index 0000000..4e0244d --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ErrorInfo.hrl @@ -0,0 +1,3 @@ +-record(error_info, { + error_info :: gleam@dict:dict(gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Expected.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Expected.hrl new file mode 100644 index 0000000..5e40ad3 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Expected.hrl @@ -0,0 +1 @@ +-record(expected, {value :: gleam@dynamic:dynamic_()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Expression.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Expression.hrl new file mode 100644 index 0000000..7aa0c35 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Expression.hrl @@ -0,0 +1 @@ +-record(expression, {expression :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_File.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_File.hrl new file mode 100644 index 0000000..1274b74 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_File.hrl @@ -0,0 +1 @@ +-record(file, {filename :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GenericException.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GenericException.hrl new file mode 100644 index 0000000..7c33d0d --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GenericException.hrl @@ -0,0 +1 @@ +-record(generic_exception, {value :: gleam@dynamic:dynamic_()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GleamAssert.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GleamAssert.hrl new file mode 100644 index 0000000..095748c --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GleamAssert.hrl @@ -0,0 +1 @@ +-record(gleam_assert, {value :: gleam@dynamic:dynamic_(), line_no :: integer()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GleamError.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GleamError.hrl new file mode 100644 index 0000000..68e6645 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_GleamError.hrl @@ -0,0 +1,3 @@ +-record(gleam_error, { + details :: showtime@internal@common@test_result:gleam_error_detail() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Ignored.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Ignored.hrl new file mode 100644 index 0000000..87b7e2f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Ignored.hrl @@ -0,0 +1 @@ +-record(ignored, {reason :: showtime@internal@common@test_result:ignore_reason()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_LetAssert.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_LetAssert.hrl new file mode 100644 index 0000000..5f3f60d --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_LetAssert.hrl @@ -0,0 +1,7 @@ +-record(let_assert, { + module :: binary(), + function :: binary(), + line_no :: integer(), + message :: binary(), + value :: gleam@dynamic:dynamic_() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Line.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Line.hrl new file mode 100644 index 0000000..9807df6 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Line.hrl @@ -0,0 +1 @@ +-record(line, {line_no :: integer()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Module.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Module.hrl new file mode 100644 index 0000000..8002c0c --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Module.hrl @@ -0,0 +1 @@ +-record(module, {name :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Num.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Num.hrl new file mode 100644 index 0000000..c36efa3 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Num.hrl @@ -0,0 +1 @@ +-record(num, {arity :: integer()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Pattern.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Pattern.hrl new file mode 100644 index 0000000..6aa9c84 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Pattern.hrl @@ -0,0 +1 @@ +-record(pattern, {pattern :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ReasonLine.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ReasonLine.hrl new file mode 100644 index 0000000..b7ad1ab --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_ReasonLine.hrl @@ -0,0 +1 @@ +-record(reason_line, {line_no :: integer()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TestFunctionReturn.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TestFunctionReturn.hrl new file mode 100644 index 0000000..b0bc294 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TestFunctionReturn.hrl @@ -0,0 +1,4 @@ +-record(test_function_return, { + value :: gleam@dynamic:dynamic_(), + output_buffer :: list(binary()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Trace.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Trace.hrl new file mode 100644 index 0000000..4cb007c --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Trace.hrl @@ -0,0 +1,5 @@ +-record(trace, { + function :: binary(), + arity :: showtime@internal@common@test_result:arity_(), + extra_info :: list(showtime@internal@common@test_result:extra_info()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TraceList.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TraceList.hrl new file mode 100644 index 0000000..c1aa9c5 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TraceList.hrl @@ -0,0 +1,3 @@ +-record(trace_list, { + traces :: list(showtime@internal@common@test_result:trace()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TraceModule.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TraceModule.hrl new file mode 100644 index 0000000..595362f --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_TraceModule.hrl @@ -0,0 +1,6 @@ +-record(trace_module, { + module :: binary(), + function :: binary(), + arity :: showtime@internal@common@test_result:arity_(), + extra_info :: list(showtime@internal@common@test_result:extra_info()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Value.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Value.hrl new file mode 100644 index 0000000..3a4b0dd --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_result_Value.hrl @@ -0,0 +1 @@ +-record(value, {value :: gleam@dynamic:dynamic_()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_CompletedTestRun.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_CompletedTestRun.hrl new file mode 100644 index 0000000..927a0cf --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_CompletedTestRun.hrl @@ -0,0 +1,6 @@ +-record(completed_test_run, { + test_function :: showtime@internal@common@test_suite:test_function(), + total_time :: integer(), + result :: {ok, showtime@internal@common@test_result:test_return()} | + {error, showtime@internal@common@test_result:exception()} +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTest.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTest.hrl new file mode 100644 index 0000000..13df1bf --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTest.hrl @@ -0,0 +1,6 @@ +-record(end_test, { + test_module :: showtime@internal@common@test_suite:test_module(), + test_function :: showtime@internal@common@test_suite:test_function(), + result :: {ok, showtime@internal@common@test_result:test_return()} | + {error, showtime@internal@common@test_result:exception()} +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTestRun.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTestRun.hrl new file mode 100644 index 0000000..3f78991 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTestRun.hrl @@ -0,0 +1 @@ +-record(end_test_run, {num_modules :: integer()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTestSuite.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTestSuite.hrl new file mode 100644 index 0000000..a7f37b3 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_EndTestSuite.hrl @@ -0,0 +1,3 @@ +-record(end_test_suite, { + test_module :: showtime@internal@common@test_suite:test_module() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_OngoingTestRun.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_OngoingTestRun.hrl new file mode 100644 index 0000000..f52e5cc --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_OngoingTestRun.hrl @@ -0,0 +1,4 @@ +-record(ongoing_test_run, { + test_function :: showtime@internal@common@test_suite:test_function(), + started_at :: integer() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_StartTest.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_StartTest.hrl new file mode 100644 index 0000000..d532609 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_StartTest.hrl @@ -0,0 +1,4 @@ +-record(start_test, { + test_module :: showtime@internal@common@test_suite:test_module(), + test_function :: showtime@internal@common@test_suite:test_function() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_StartTestSuite.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_StartTestSuite.hrl new file mode 100644 index 0000000..d5a03d3 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_StartTestSuite.hrl @@ -0,0 +1,3 @@ +-record(start_test_suite, { + test_module :: showtime@internal@common@test_suite:test_module() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestFunction.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestFunction.hrl new file mode 100644 index 0000000..a783ba4 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestFunction.hrl @@ -0,0 +1 @@ +-record(test_function, {name :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestModule.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestModule.hrl new file mode 100644 index 0000000..ee9baaf --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestModule.hrl @@ -0,0 +1 @@ +-record(test_module, {name :: binary(), path :: gleam@option:option(binary())}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestSuite.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestSuite.hrl new file mode 100644 index 0000000..253a946 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@common@test_suite_TestSuite.hrl @@ -0,0 +1,4 @@ +-record(test_suite, { + module :: showtime@internal@common@test_suite:test_module(), + tests :: list(showtime@internal@common@test_suite:test_function()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignLeft.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignLeft.hrl new file mode 100644 index 0000000..ca52968 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignLeft.hrl @@ -0,0 +1,4 @@ +-record(align_left, { + content :: showtime@internal@reports@table:content(), + margin :: integer() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignLeftOverflow.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignLeftOverflow.hrl new file mode 100644 index 0000000..8d5a673 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignLeftOverflow.hrl @@ -0,0 +1,4 @@ +-record(align_left_overflow, { + content :: showtime@internal@reports@table:content(), + margin :: integer() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignRight.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignRight.hrl new file mode 100644 index 0000000..7f7a3f0 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignRight.hrl @@ -0,0 +1,4 @@ +-record(align_right, { + content :: showtime@internal@reports@table:content(), + margin :: integer() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignRightOverflow.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignRightOverflow.hrl new file mode 100644 index 0000000..4fc4536 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_AlignRightOverflow.hrl @@ -0,0 +1,4 @@ +-record(align_right_overflow, { + content :: showtime@internal@reports@table:content(), + margin :: integer() +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Aligned.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Aligned.hrl new file mode 100644 index 0000000..2343dfd --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Aligned.hrl @@ -0,0 +1 @@ +-record(aligned, {content :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Content.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Content.hrl new file mode 100644 index 0000000..044891b --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Content.hrl @@ -0,0 +1 @@ +-record(content, {unstyled_text :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Separator.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Separator.hrl new file mode 100644 index 0000000..db3f822 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Separator.hrl @@ -0,0 +1 @@ +-record(separator, {char :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_StyledContent.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_StyledContent.hrl new file mode 100644 index 0000000..ed500df --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_StyledContent.hrl @@ -0,0 +1 @@ +-record(styled_content, {styled_text :: binary()}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Table.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Table.hrl new file mode 100644 index 0000000..5b41bb1 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@internal@reports@table_Table.hrl @@ -0,0 +1,4 @@ +-record(table, { + header :: gleam@option:option(binary()), + rows :: list(list(showtime@internal@reports@table:col())) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@tests@meta_Meta.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@meta_Meta.hrl new file mode 100644 index 0000000..14184fb --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@meta_Meta.hrl @@ -0,0 +1 @@ +-record(meta, {description :: binary(), tags :: list(binary())}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_Eq.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_Eq.hrl new file mode 100644 index 0000000..6ebea34 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_Eq.hrl @@ -0,0 +1,5 @@ +-record(eq, { + a :: any(), + b :: any(), + meta :: gleam@option:option(showtime@tests@meta:meta()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_Fail.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_Fail.hrl new file mode 100644 index 0000000..cf06a3c --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_Fail.hrl @@ -0,0 +1 @@ +-record(fail, {meta :: gleam@option:option(showtime@tests@meta:meta())}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_IsError.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_IsError.hrl new file mode 100644 index 0000000..e9cabf3 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_IsError.hrl @@ -0,0 +1,4 @@ +-record(is_error, { + a :: {ok, any()} | {error, any()}, + meta :: gleam@option:option(showtime@tests@meta:meta()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_IsOk.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_IsOk.hrl new file mode 100644 index 0000000..37c24ca --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_IsOk.hrl @@ -0,0 +1,4 @@ +-record(is_ok, { + a :: {ok, any()} | {error, any()}, + meta :: gleam@option:option(showtime@tests@meta:meta()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_NotEq.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_NotEq.hrl new file mode 100644 index 0000000..2a6bf48 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@should_NotEq.hrl @@ -0,0 +1,5 @@ +-record(not_eq, { + a :: any(), + b :: any(), + meta :: gleam@option:option(showtime@tests@meta:meta()) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@tests@test_MetaShould.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@test_MetaShould.hrl new file mode 100644 index 0000000..a814a93 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@test_MetaShould.hrl @@ -0,0 +1,4 @@ +-record(meta_should, { + equal :: fun((any(), any()) -> nil), + not_equal :: fun((any(), any()) -> nil) +}). diff --git a/aoc2023/build/dev/erlang/adglent/include/showtime@tests@test_Test.hrl b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@test_Test.hrl new file mode 100644 index 0000000..e75a0b7 --- /dev/null +++ b/aoc2023/build/dev/erlang/adglent/include/showtime@tests@test_Test.hrl @@ -0,0 +1,4 @@ +-record(test, { + meta :: showtime@tests@meta:meta(), + test_function :: fun(() -> nil) +}). |