Skip to content

Commit

Permalink
Add tests and fix some colors
Browse files Browse the repository at this point in the history
  • Loading branch information
julianduque committed Jan 18, 2014
1 parent c16f0b7 commit f640fad
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 1,3 @@
*.dump
ebin/
.eunit/
6 changes: 3 additions & 3 deletions include/color.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 10,8 @@
-define(GREEN, "32").
-define(YELLOW, "33").
-define(BLUE, "34").
-define(MAGENTA, "36").
-define(CYAN, "37").
-define(WHITE, "38").
-define(MAGENTA, "35").
-define(CYAN, "36").
-define(WHITE, "37").
-define(DEFAULT, "39").

29 changes: 29 additions & 0 deletions test/color_test.erl
Original file line number Diff line number Diff line change
@@ -0,0 1,29 @@
-module(color_test).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").

%% Colors
black_test() ->
?assertEqual("\e[30mblack\e[0m", color:black("black")).

red_test() ->
?assertEqual("\e[31mred\e[0m", color:red("red")).

green_test() ->
?assertEqual("\e[32mgreen\e[0m", color:green("green")).

yellow_test() ->
?assertEqual("\e[33myellow\e[0m", color:yellow("yellow")).

blue_test() ->
?assertEqual("\e[34mblue\e[0m", color:blue("blue")).

magenta_test() ->
?assertEqual("\e[35mmagenta\e[0m", color:magenta("magenta")).

cyan_test() ->
?assertEqual("\e[36mcyan\e[0m", color:cyan("cyan")).

white_test() ->
?assertEqual("\e[37mwhite\e[0m", color:white("white")).

0 comments on commit f640fad

Please sign in to comment.