Created
September 10, 2012 11:20
-
-
Save wardbekker/3690396 to your computer and use it in GitHub Desktop.
Sample EUnit test of addition function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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