summaryrefslogtreecommitdiff
path: root/test/rebar_utils_SUITE.erl
diff options
context:
space:
mode:
authorHeinz N. Gies <heinz@licenser.net>2016-02-08 11:15:59 -0500
committerHeinz N. Gies <heinz@licenser.net>2016-02-08 11:15:59 -0500
commit2f563041cb248ba0cac27b92da5dcc3e7be27f80 (patch)
treee27ecaf59cfeb0e6406f1f4ce753842ff52855d5 /test/rebar_utils_SUITE.erl
parent91c47db27a3c63fc04940c7c72433062dbadf042 (diff)
parent7fab47dfa05754242790a748bbd303ffe9703e5c (diff)
Merge master
Diffstat (limited to 'test/rebar_utils_SUITE.erl')
-rw-r--r--test/rebar_utils_SUITE.erl78
1 files changed, 76 insertions, 2 deletions
diff --git a/test/rebar_utils_SUITE.erl b/test/rebar_utils_SUITE.erl
index 24e8afe..b32992d 100644
--- a/test/rebar_utils_SUITE.erl
+++ b/test/rebar_utils_SUITE.erl
@@ -30,7 +30,8 @@
invalid_otp_version/1,
nonblacklisted_otp_version/1,
blacklisted_otp_version/1,
- sh_does_not_miss_messages/1]).
+ sh_does_not_miss_messages/1,
+ tup_merge/1]).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
@@ -44,7 +45,8 @@ end_per_testcase(_, _Config) ->
all() ->
[{group, args_to_tasks},
- sh_does_not_miss_messages].
+ sh_does_not_miss_messages,
+ tup_merge].
groups() ->
[{args_to_tasks, [], [empty_arglist,
@@ -198,3 +200,75 @@ sh_does_not_miss_messages(_Config) ->
false
end,
AnyMessageRemained = false.
+
+tup_merge(_Config) ->
+ ?assertEqual(
+ [a,{a,a},{a,a,a},{a,b},{a,b,b},b,{b,a},{b,a,a},{b,b},{b,b,b},z,{z,a},{z,a,a},{z,b},{z,b,b}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([a,{a,a},{a,a,a},b,{b,a},{b,a,a},z,{z,a},{z,a,a}]),
+ rebar_utils:tup_sort([a,{a,b},{a,b,b},b,{b,b},{b,b,b},z,{z,b},{z,b,b}])
+ )
+ ),
+ ?assertEqual(
+ [a,{a,b},{a,b,b},{a,a},{a,a,a},b,{b,b},{b,b,b},{b,a},{b,a,a},z,{z,b},{z,b,b},{z,a},{z,a,a}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([a,{a,b},{a,b,b},b,{b,b},{b,b,b},z,{z,b},{z,b,b}]),
+ rebar_utils:tup_sort([a,{a,a},{a,a,a},b,{b,a},{b,a,a},z,{z,a},{z,a,a}])
+ )
+ ),
+ ?assertEqual(
+ [a,{a,b},{a,b,b},{a,a},{a,a,a},b,{b,b},{b,b,b},{b,a},{b,a,a},z,{z,b},{z,b,b},{z,a},{z,a,a}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([a,b,z,{a,b},{b,b},{z,b},{a,b,b},{b,b,b},{z,b,b}]),
+ rebar_utils:tup_sort([a,{a,a},{a,a,a},b,{b,a},{b,a,a},z,{z,a},{z,a,a}])
+ )
+ ),
+ ?assertEqual(
+ [{a,b},a,{a,b,b},{a,a},{a,a,a},{b,b},b,{b,b,b},{b,a},{b,a,a},{z,b},z,{z,b,b},{z,a},{z,a,a}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([{a,b},{b,b},{z,b},a,b,z,{a,b,b},{b,b,b},{z,b,b}]),
+ rebar_utils:tup_sort([a,{a,a},{a,a,a},b,{b,a},{b,a,a},z,{z,a},{z,a,a}])
+ )
+ ),
+ ?assertEqual(
+ [a,{a,b},{a,b,b},{a,a},{a,a,a},b,{b,b},{b,b,b},{b,a},{b,a,a},z,{z,b},{z,b,b},{z,a},{z,a,a}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([a,{a,b},{a,b,b},b,{b,b},{b,b,b},z,{z,b},{z,b,b}]),
+ rebar_utils:tup_sort([{a,a},a,{a,a,a},{b,a},b,{b,a,a},{z,a},z,{z,a,a}])
+ )
+ ),
+ ?assertEqual(
+ [{a,b},a,{a,b,b},{a,a},{a,a,a},{b,b},b,{b,b,b},{b,a},{b,a,a},{z,b},z,{z,b,b},{z,a},{z,a,a}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([{a,b},{b,b},{z,b},a,b,z,{a,b,b},{b,b,b},{z,b,b}]),
+ rebar_utils:tup_sort([{a,a},a,{a,a,a},{b,a},b,{b,a,a},{z,a},z,{z,a,a}])
+ )
+ ),
+ ?assertEqual(
+ [{a,b},{a,b,b},a,{a,a},{a,a,a},{b,b},{b,b,b},b,{b,a},{b,a,a},{z,b},{z,b,b},z,{z,a},{z,a,a}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([{a,b},{a,b,b},{b,b},{b,b,b},{z,b},{z,b,b},a,b,z]),
+ rebar_utils:tup_sort([{a,a},{a,a,a},a,{b,a},{b,a,a},b,{z,a},{z,a,a},z])
+ )
+ ),
+ ?assertEqual(
+ [{a,b},{a,b,b},a,{a,a},{a,a,a},{b,b},{b,b,b},b,{b,a},{b,a,a},{z,b},{z,b,b},z,{z,a},{z,a,a}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([{a,b},{a,b,b},{b,b},{b,b,b},{z,b},{z,b,b},a,b,z]),
+ rebar_utils:tup_sort([{a,a},{a,b},{a,a,a},{a,b,b},a,{b,a},{b,a,a},b,{z,a},{z,a,a},z])
+ )
+ ),
+ ?assertEqual(
+ [{l, a}, {r, a, b}, {s, a}, {s, b}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([{r, a, b}, {s, a}, {l, a}]),
+ rebar_utils:tup_sort([{s, b}])
+ )
+ ),
+ ?assertEqual(
+ [{a,b,b},{a,b},a,{a,a},{a,a,a},{b,b},{b,b,b},b,{b,a,a},{b,a},{z,b},{z,b,b},z,{z,a},{z,a,a}],
+ rebar_utils:tup_umerge(
+ rebar_utils:tup_sort([{a,b,b},{b,b},{a,b},{b,b,b},{z,b},{z,b,b},a,b,z]),
+ rebar_utils:tup_sort([{a,a},{a,a,a},a,{b,a,a},b,{z,a},{z,a,a},{b,a},z])
+ )
+ ).