A little minor formatting cleanup

This commit is contained in:
Eric Merritt 2011-04-22 09:36:29 -05:00 committed by Jordan Wilberding
parent 07a54bb518
commit 8dda138814
4 changed files with 29 additions and 22 deletions

View file

@ -243,7 +243,6 @@ remove_recursive(Path, Options) ->
tmp() ->
case erlang:system_info(system_architecture) of
"win32" ->
% XXX TODO better tmp dir for windows perhaps :)
"./tmp";
_SysArch ->
"/tmp"

View file

@ -68,9 +68,12 @@ filter(Fun, List, Timeout) ->
-spec run_list_fun_in_parallel(atom(), fun(), [any()], integer()) -> [any()].
run_list_fun_in_parallel(ListFun, Fun, List, Timeout) ->
LocalPid = self(),
Pids = lists:map(fun(E) ->
Pid = proc_lib:spawn(fun() ->
wait(LocalPid, Fun, E, Timeout)
Pids =
lists:map(fun(E) ->
Pid =
proc_lib:spawn(fun() ->
wait(LocalPid, Fun,
E, Timeout)
end),
{Pid, E}
end, List),
@ -248,6 +251,7 @@ ftmap_bad_test() ->
N
end,
lists:seq(1, 5), infinity),
?assertMatch([{value, 1}, test_exception, {value, 3}, {value, 4}, {value, 5}] , Results).
?assertMatch([{value, 1}, test_exception, {value, 3},
{value, 4}, {value, 5}] , Results).
-endif.

View file

@ -40,6 +40,7 @@ compare(VsnA, VsnB) ->
%%%===================================================================
%%% Internal Functions
%%%===================================================================
-spec tokens(semvar()) -> parsed_semvar().
tokens(Vsn) ->
[MajorVsn, MinorVsn, RawPatch] = string:tokens(Vsn, "."),
@ -67,11 +68,14 @@ compare_toks({MajA, MinA, PVA, PSA}, {MajB, MinB, PVB, PSB}) ->
{to_int(MajB), to_int(MinB), to_int(PVB), PSB}).
-spec compare_toks2(parsed_semvar(), parsed_semvar()) -> boolean().
compare_toks2({MajA, _MinA, _PVA, _PSA}, {MajB, _MinB, _PVB, _PSB}) when MajA > MajB ->
compare_toks2({MajA, _MinA, _PVA, _PSA}, {MajB, _MinB, _PVB, _PSB})
when MajA > MajB ->
true;
compare_toks2({_Maj, MinA, _PVA, _PSA}, {_Maj, MinB, _PVB, _PSB}) when MinA > MinB ->
compare_toks2({_Maj, MinA, _PVA, _PSA}, {_Maj, MinB, _PVB, _PSB})
when MinA > MinB ->
true;
compare_toks2({_Maj, _Min, PVA, _PSA}, {_Maj, _Min, PVB, _PSB}) when PVA > PVB ->
compare_toks2({_Maj, _Min, PVA, _PSA}, {_Maj, _Min, PVB, _PSB})
when PVA > PVB ->
true;
compare_toks2({_Maj, _Min, _PV, ""}, {_Maj, _Min, _PV, PSB}) when PSB /= ""->
true;
@ -91,7 +95,6 @@ to_int(String) ->
throw(invalid_semver_string)
end.
%%%===================================================================
%%% Test Functions
%%%===================================================================

View file

@ -62,9 +62,11 @@ compare_against_nothing(Str) ->
-spec fine_compare({string(), string()}, string(),
{string(), string()}, string()) ->
boolean().
fine_compare({_StrDigA, StrA}, TA, {_StrDigB, _StrB}, _TB) when StrA /= "", TA /= [] ->
fine_compare({_StrDigA, StrA}, TA, {_StrDigB, _StrB}, _TB)
when StrA /= "", TA /= [] ->
throw(invalid_version_string);
fine_compare({_StrDigA, _StrA}, _TA, {_StrDigB, StrB}, TB) when StrB /= "", TB /= [] ->
fine_compare({_StrDigA, _StrA}, _TA, {_StrDigB, StrB}, TB)
when StrB /= "", TB /= [] ->
throw(invalid_version_string);
fine_compare({"", _StrA}, _TA, {StrDigB, _StrB}, _TB) when StrDigB /= "" ->
false;
@ -98,7 +100,6 @@ split_numeric_alpha([Dig|T], {PatchVsn, PatchStr})
split_numeric_alpha(PatchStr, {PatchVsn, ""}) ->
{PatchVsn, PatchStr}.
%%%===================================================================
%%% Test Functions
%%%===================================================================