Skip to content

Instantly share code, notes, and snippets.

@wardbekker
Created September 10, 2012 11:20
Show Gist options
  • Save wardbekker/3690396 to your computer and use it in GitHub Desktop.
Save wardbekker/3690396 to your computer and use it in GitHub Desktop.
Sample EUnit test of addition function
-module(ci_quickstart_math).
-export([addition/2]).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
addition(X, Y) ->
X + Y.
-ifdef(TEST).
%% EUNIT TEST
simple_test() ->
?assertEqual(4, addition(2,2)),
?assertNotEqual(3, addition(1,1)).
-endif.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment