diff options
author | Anders Svensson <[email protected]> | 2012-11-14 20:07:17 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2012-11-19 15:45:50 +0100 |
commit | b318cb48b9a2e7609d4406138600e4873dbce0c5 (patch) | |
tree | ae55e5f1f06aaf0c8a0eceb1ffa487dd05953d02 /lib/diameter/test/diameter_util.erl | |
parent | 78105c1948ed14df8cbc6ff085f61624786771c0 (diff) | |
download | otp-b318cb48b9a2e7609d4406138600e4873dbce0c5.tar.gz otp-b318cb48b9a2e7609d4406138600e4873dbce0c5.tar.bz2 otp-b318cb48b9a2e7609d4406138600e4873dbce0c5.zip |
Minor test suite tweaks
Diffstat (limited to 'lib/diameter/test/diameter_util.erl')
-rw-r--r-- | lib/diameter/test/diameter_util.erl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/diameter/test/diameter_util.erl b/lib/diameter/test/diameter_util.erl index 890d24f6f8..5af4ad9ba5 100644 --- a/lib/diameter/test/diameter_util.erl +++ b/lib/diameter/test/diameter_util.erl @@ -24,7 +24,8 @@ %% %% generic --export([consult/2, +-export([name/1, + consult/2, run/1, fold/3, foldl/3, @@ -45,6 +46,21 @@ -define(L, atom_to_list). + +%% --------------------------------------------------------------------------- +%% name/2 +%% +%% Contruct and deconstruct lists of atoms as atoms to work around +%% group names in common_test being restricted to atoms. + +name(Names) + when is_list(Names) -> + list_to_atom(string:join([atom_to_list(A) || A <- Names], ",")); + +name(A) + when is_atom(A) -> + [list_to_atom(S) || S <- string:tokens(atom_to_list(A), ",")]. + %% --------------------------------------------------------------------------- %% consult/2 %% |