Skip to content

Commit

Permalink
Moved ec_git_vsn tests into separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
ariel-anieli committed Jul 18, 2024
1 parent a54f062 commit 7729cc2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/ec_git_vsn.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

%% API
-export([new/0,
vsn/1]).
vsn/1,
parse_tags/1,
get_patch_count/1,
collect_default_refcount/1]).

-export_type([t/0]).

Expand Down Expand Up @@ -98,16 +101,3 @@ parse_tags(Pattern) ->
Vsn1 = string:trim(string:trim(Vsn, leading, "v"), trailing, "\n"),
{Tag, Vsn1}
end.

-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").

parse_tags_test() ->
?assertEqual({undefined, ""}, parse_tags("a.b.c")).

get_patch_count_test() ->
?assertEqual(0, get_patch_count("a.b.c")).

collect_default_refcount_test() ->
?assertMatch({"", _, _}, collect_default_refcount("a.b.c")).
-endif.
13 changes: 13 additions & 0 deletions test/ec_git_vsn_tests.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%%% @copyright 2024 Erlware, LLC.
-module(ec_git_vsn_tests).

-include_lib("eunit/include/eunit.hrl").

parse_tags_test() ->
?assertEqual({undefined, ""}, ec_git_vsn:parse_tags("a.b.c")).

get_patch_count_test() ->
?assertEqual(0, ec_git_vsn:get_patch_count("a.b.c")).

collect_default_refcount_test() ->
?assertMatch({"", _, _}, ec_git_vsn:collect_default_refcount("a.b.c")).

0 comments on commit 7729cc2

Please sign in to comment.