exercism/erlang/leap/leap_tests.erl

21 lines
387 B
Erlang
Raw Normal View History

2016-08-13 23:20:14 +00:00
% To run tests:
% erl -make
% erl -noshell -eval "eunit:test(leap, [verbose])" -s init stop
%
-module(leap_tests).
-include_lib("eunit/include/eunit.hrl").
leap_year_test() ->
?assert(leap:leap_year(1996)).
non_leap_year_test() ->
?assertNot(leap:leap_year(1997)).
century_test() ->
?assertNot(leap:leap_year(1900)).
fourth_century_test() ->
?assert(leap:leap_year(2400)).