Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(lab02_tests).
- -include_lib("eunit/include/eunit.hrl").
- mix_1_test() ->
- ?assertEqual({"iced tea + lemonade", 25}, lab02:mixBeverages({"iced tea", 23}, {"lemonade", 2})).
- isOlder_1_test() ->
- false = lab02:isOlder({10, 3, 2016}, {10, 3, 2016}).
- isOlder_2_test() ->
- true = lab02:isOlder({10, 3, 2016}, {11, 3, 2016}).
- isOlder_3_test() ->
- true = lab02:isOlder({10, 1, 2016}, {10, 2, 2016}).
- isOlder_4_test() ->
- false = lab02:isOlder({10, 3, 2016}, {11, 2, 2016}).
- isOlder_5_test() ->
- true = lab02:isOlder({10, 12, 2015}, {10, 12, 2016}).
- isOlder_6_test() ->
- true = lab02:isOlder({11, 12, 2015}, {10, 12, 2016}).
- isOlder_7_test() ->
- true = lab02:isOlder({12, 11, 2016}, {12, 10, 2017}).
- isOlder_8_test() ->
- true = lab02:isOlder({12, 10, 2016}, {11, 3, 2017}).
- moveDecimal_1_test() ->
- [] = lab02:moveDecimal([], 1).
- moveDecimal_2_test() ->
- [10.0, 20.0, 30.0] = lab02:moveDecimal([1,2,3], 1).
- moveDecimal_3_test() ->
- [0.10, 0.20] = lab02:moveDecimal([1,2], -1).
- removeNegatives_1_test() ->
- ?assertEqual([0,1,2], lab02:removeNegatives([-1,0,1,2,-3])).
- removeNegatives2_1_test() ->
- [0,1,2] = lab02:removeNegatives2([-1,0,1,2,-3]).
- calculatePay_1_test() ->
- {john, 1000} = lab02:calculatePay({john,100,10}).
- generate_1_test() ->
- [] = lab02:generate(100,1,2).
- generate_2_test() ->
- [3,5,7] = lab02:generate(3,8,2).
- getnth_1_test() ->
- {error, no_such_element} = lab02:getnth( [ ], 2).
- getnth_2_test() ->
- {error, no_such_element} = lab02:getnth( ["hello", "there"], 3).
- getnth_3_test() ->
- {error, no_such_element} = lab02:getnth( ["hello", "there"], 0).
- getnth_4_test() ->
- "there" = lab02:getnth( ["hello", "there"], 2).
- getnth_5_test() ->
- "there" = lab02:getnth( ["hello", "there", "where"], 2).
- getnth_6_test() ->
- "where" = lab02:getnth( ["hello", "there", "where"], 3).
- getnth_7_test() ->
- "where" = lab02:getnth( ["hello", "there", "where", "here"], 3).
- repeat_1_test() ->
- [2, 2, 2, 2, 3] = lab02:repeat([1, 2, 3], [0, 4, 1]).
- repeat_2_test() ->
- [] = lab02:repeat( [], [0, 4, 1]).
- repeat_3_test() ->
- [] = lab02:repeat( [1, 2, 3], []).
- repeat_4_test() ->
- [4,4] = lab02:repeat( [4,5,6], [2]).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement