Sha256: a95e5abb9ff62d4441b772777ed4b113591bca006b90073bf059223b79260c7a

Contents?: true

Size: 1.09 KB

Versions: 22

Compression:

Stored size: 1.09 KB

Contents

-module(roman_numerals_tests).

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

% To run tests:
% erlc -make
% erl -noshell -eval "eunit:test(etl, [verbose])" -s init stop

expect_roman(Number, Expected) ->
  ?assertEqual(roman_numerals:numerals(Number), Expected).

convert_1_test() -> expect_roman(1, "I").

convert_2_test() -> expect_roman(2, "II").

convert_3_test() -> expect_roman(3, "III").

convert_4_test() -> expect_roman(4, "IV").

convert_5_test() -> expect_roman(5, "V").

convert_6_test() -> expect_roman(6, "VI").

convert_9_test() -> expect_roman(9, "IX").

convert_27_test() -> expect_roman(27, "XXVII").

convert_48_test() -> expect_roman(48, "XLVIII").

convert_59_test() -> expect_roman(59, "LIX").

convert_93_test() -> expect_roman(93, "XCIII").

convert_141_test() -> expect_roman(141, "CXLI").

convert_163_test() -> expect_roman(163, "CLXIII").

convert_402_test() -> expect_roman(402, "CDII").

convert_575_test() -> expect_roman(575, "DLXXV").

convert_911_test() -> expect_roman(911, "CMXI").

convert_1024_test() -> expect_roman(1024, "MXXIV").

convert_3000_test() -> expect_roman(3000, "MMM").

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
trackler-2.0.6.28 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.27 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.26 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.25 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.24 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.23 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.22 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.21 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.20 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.19 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.18 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.17 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.16 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.15 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.14 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.13 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.12 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.11 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.10 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl
trackler-2.0.6.9 tracks/erlang/exercises/roman-numerals/roman_numerals_tests.erl