Sha256: 48bcc39c503ce1e5f568ea2567da9b128953f0444421d56b4d2adcb0159ce3f9

Contents?: true

Size: 889 Bytes

Versions: 116

Compression:

Stored size: 889 Bytes

Contents

-module(collatz_conjecture_tests).

% This file is automatically generated from the exercises canonical data.

-include_lib("erl_exercism/include/exercism.hrl").
-include_lib("eunit/include/eunit.hrl").


zero_steps_for_one_test() ->
    ?assertMatch(0, collatz_conjecture:steps(1)).

divide_if_even_test() ->
    ?assertMatch(4, collatz_conjecture:steps(16)).

even_and_odd_steps_test() ->
    ?assertMatch(9, collatz_conjecture:steps(12)).

large_number_of_even_and_odd_steps_test() ->
    ?assertMatch(152, collatz_conjecture:steps(1000000)).

zero_is_an_error_test() ->
    ?assertMatch({error,
		  "Only positive numbers are allowed"},
		 collatz_conjecture:steps(0)).

negative_value_is_an_error_test() ->
    ?assertMatch({error,
		  "Only positive numbers are allowed"},
		 collatz_conjecture:steps(-15)).

version_test() ->
    ?assertMatch(2, collatz_conjecture:test_version()).

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.179 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.178 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.177 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.176 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.175 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.174 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.173 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.172 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.171 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.170 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.169 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.167 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.166 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.165 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.164 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.163 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.162 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.161 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl
trackler-2.2.1.160 tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl