Skip to content
Browse files

Added the cap1H feature

  • Loading branch information...
1 parent 20ac7e0 commit b2868c2a93c397a098f778e257bf3cbaa8316249 @Gianfrancoalongi committed Dec 7, 2012
Showing with 18 additions and 1 deletion.
  1. +8 −0 run1/src/o_plugin_cap1H.erl
  2. +10 −1 run1/test/mrz_tests.erl
View
8 run1/src/o_plugin_cap1H.erl
@@ -0,0 +1,8 @@
+-module(o_plugin_cap1H).
+-export([act/1]).
+act(Input) ->
+ Words = string:tokens(Input," "),
+ {A,B} = lists:split(round(length(Words)/2),Words),
+ string:join(lists:map(fun string:to_upper/1,
+ A)++B,
+ " ").
View
11 run1/test/mrz_tests.erl
@@ -10,9 +10,18 @@ mrz_options_test_() ->
fun rev2_test_function/1,
fun lowerwhole_test_function/1,
fun lower2_test_function/1,
- fun cap2H_test_function/1
+ fun cap2H_test_function/1,
+ fun cap1H_test_function/1
]}.
+cap1H_test_function(FileHandle) ->
+ fun() ->
+ group_leader(FileHandle,self()),
+ mrz:run([helloworld,cap1H,stdout]),
+ {ok,Res} = file:read_file("test_res.txt"),
+ ?assertEqual(<<"HELLO world">>,Res)
+ end.
+
cap2H_test_function(FileHandle) ->
fun() ->
group_leader(FileHandle,self()),

0 comments on commit b2868c2

Please sign in to comment.
Something went wrong with that request. Please try again.