summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/rebar_otp_release_tests.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/rebar_otp_release_tests.erl b/test/rebar_otp_release_tests.erl
index 05e9993..61efdad 100644
--- a/test/rebar_otp_release_tests.erl
+++ b/test/rebar_otp_release_tests.erl
@@ -28,16 +28,20 @@
-include_lib("eunit/include/eunit.hrl").
-otp_release_test() ->
- ?_assert(check_otp_release()).
-
-check_otp_release() ->
+check_otp_release_test() ->
case rebar_utils:otp_release() of
%% <= R16
[$R,N|_] when is_integer(N) ->
- true;
+ ?assert(true);
%% >= 17.x
[N|_]=Rel when is_integer(N) ->
%% Check that it has at least Major.Minor
- length(string:tokens(Rel, ".")) > 1
+ ?assert(length(string:tokens(Rel, ".")) > 1),
+
+ %% If otp_patch_apply was used and the release version has
+ %% a "**" suffix, we drop that part in otp_release/0.
+ ?assertEqual(0, string:str(Rel, "*")),
+
+ %% Check that "\n" is dropped in otp_release/0.
+ ?assertEqual(0, string:str(Rel, "\n"))
end.