blob: 5c1eab13705d4d26f1b03a43f46892edbccff700 [file] [log] [blame]
-module(bcrypt_tests).
-include_lib("eunit/include/eunit.hrl").
simple_test_() ->
{timeout, 1000, %% since bcrypt can take long, this is to avoid eunit timeout
fun() ->
application:start(crypto),
application:start(bcrypt),
{ok, Salt} = bcrypt:gen_salt(),
{ok, Hash} = bcrypt:hashpw("foo", Salt),
?assert({ok, Hash} =:= bcrypt:hashpw("foo", Hash)),
?assertNot({ok, Hash} =:= bcrypt:hashpw("bar", Hash))
end}.