this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

v1.5.1

+24 -24
+5
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 + ## v1.5.1 - 2025-06-11 4 + 5 + - Fixed a bug where Erlang modules in subdirectories within `test` could cause 6 + the test runner to fail. 7 + 3 8 ## v1.5.0 - 2025-06-11 4 9 5 10 - Improved the format for unexpected errors on JavaScript.
+1 -1
gleam.toml
··· 1 1 name = "gleeunit" 2 - version = "1.5.0" 2 + version = "1.5.1" 3 3 licences = ["Apache-2.0"] 4 4 description = "A simple test runner for Gleam, using EUnit on Erlang" 5 5 repository = { type = "github", user = "lpil", repo = "gleeunit" }
+14 -4
src/gleeunit.gleam
··· 1 1 import gleam/list 2 + import gleam/result 2 3 import gleam/string 3 4 4 5 /// Find and run all test functions for the current project using Erlang's EUnit ··· 34 35 fn halt(a: Int) -> Nil 35 36 36 37 fn gleam_to_erlang_module_name(path: String) -> String { 37 - path 38 - |> string.replace(".gleam", "") 39 - |> string.replace(".erl", "") 40 - |> string.replace("/", "@") 38 + case string.ends_with(path, ".gleam") { 39 + True -> 40 + path 41 + |> string.replace(".gleam", "") 42 + |> string.replace("/", "@") 43 + 44 + False -> 45 + path 46 + |> string.split("/") 47 + |> list.last 48 + |> result.unwrap(path) 49 + |> string.replace(".erl", "") 50 + } 41 51 } 42 52 43 53 @external(erlang, "gleeunit_ffi", "find_files")
+1 -17
src/gleeunit_ffi.erl
··· 1 1 -module(gleeunit_ffi). 2 2 3 - -export([find_files/2, should_equal/2, should_not_equal/2, should_be_ok/1, 4 - should_be_error/1, run_eunit/2]). 5 - 6 - -include_lib("eunit/include/eunit.hrl"). 3 + -export([find_files/2, run_eunit/2]). 7 4 8 5 find_files(Pattern, In) -> 9 6 Results = filelib:wildcard(binary_to_list(Pattern), binary_to_list(In)), 10 7 lists:map(fun list_to_binary/1, Results). 11 - 12 - should_equal(Actual, Expected) -> 13 - ?assertEqual(Expected, Actual), 14 - nil. 15 - should_not_equal(Actual, Expected) -> 16 - ?assertNotEqual(Expected, Actual), 17 - nil. 18 - should_be_ok(A) -> 19 - ?assertMatch({ok, _}, A), 20 - element(2, A). 21 - should_be_error(A) -> 22 - ?assertMatch({error, _}, A), 23 - element(2, A). 24 8 25 9 run_eunit(Tests, Options) -> 26 10 case eunit:test(Tests, Options) of
+3 -2
src/gleeunit_progress.erl
··· 48 48 ?reporting:test_failed(State, Module, Function, Exception) 49 49 end. 50 50 51 - handle_cancel(_test_or_group, _data, State) -> 52 - State. 51 + 52 + handle_cancel(_test_or_group, Data, State) -> 53 + ?reporting:test_failed(State, <<"gleeunit">>, <<"main">>, Data). 53 54 54 55 terminate({ok, _Data}, State) -> 55 56 ?reporting:finished(State),