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() -> tmp() ->
case erlang:system_info(system_architecture) of case erlang:system_info(system_architecture) of
"win32" -> "win32" ->
% XXX TODO better tmp dir for windows perhaps :)
"./tmp"; "./tmp";
_SysArch -> _SysArch ->
"/tmp" "/tmp"

View file

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

View file

@ -40,6 +40,7 @@ compare(VsnA, VsnB) ->
%%%=================================================================== %%%===================================================================
%%% Internal Functions %%% Internal Functions
%%%=================================================================== %%%===================================================================
-spec tokens(semvar()) -> parsed_semvar(). -spec tokens(semvar()) -> parsed_semvar().
tokens(Vsn) -> tokens(Vsn) ->
[MajorVsn, MinorVsn, RawPatch] = string: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}). {to_int(MajB), to_int(MinB), to_int(PVB), PSB}).
-spec compare_toks2(parsed_semvar(), parsed_semvar()) -> boolean(). -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; 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; 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; true;
compare_toks2({_Maj, _Min, _PV, ""}, {_Maj, _Min, _PV, PSB}) when PSB /= ""-> compare_toks2({_Maj, _Min, _PV, ""}, {_Maj, _Min, _PV, PSB}) when PSB /= ""->
true; true;
@ -91,7 +95,6 @@ to_int(String) ->
throw(invalid_semver_string) throw(invalid_semver_string)
end. end.
%%%=================================================================== %%%===================================================================
%%% Test Functions %%% Test Functions
%%%=================================================================== %%%===================================================================

View file

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