Skip to content

Instantly share code, notes, and snippets.

@ferd
Created July 1, 2015 22:47
Show Gist options
  • Save ferd/a0e616b5ad5862f470ff to your computer and use it in GitHub Desktop.
Save ferd/a0e616b5ad5862f470ff to your computer and use it in GitHub Desktop.
dedup_test_mods(Mods) ->
extract_dedups([{expand_mod(atom_to_list(Mod)), Mod} || Mod <- Mods]).
expand_mod(ModStr) ->
case lists:suffix("_test", ModStr) of
true -> ModStr;
false -> ModStr ++ "_test"
end.
extract_dedups(Mods) ->
[Mod || {_, Mod} <- lists:ukeysort(Mods)].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment