Sha256: 95b697921bb237411fe9a026a99178329a6a76fc920e220b541b73f0a4f14dd0

Contents?: true

Size: 902 Bytes

Versions: 172

Compression:

Stored size: 902 Bytes

Contents

-module(phone_number_tests).

-define(TESTED_MODULE, (sut(phone_number))).
-define(TEST_VERSION, 1).
-include("exercism.hrl").


cleans_number_test() ->
  ?assertEqual("1234567890", ?TESTED_MODULE:number("(123) 456-7890")).

cleans_number_with_dots_test() ->
  ?assertEqual("1234567890", ?TESTED_MODULE:number("123.456.7890")).

valid_when_eleven_digits_test() ->
  ?assertEqual("1234567890", ?TESTED_MODULE:number("11234567890")).

invalid_when_eleven_digits_test() ->
  ?assertEqual("0000000000", ?TESTED_MODULE:number("21234567890")).

invalid_when_nine_digits_test() ->
  ?assertEqual("0000000000", ?TESTED_MODULE:number("123456789")).

area_code_test() ->
  ?assertEqual("123", ?TESTED_MODULE:areacode("1234567890")).

pretty_print_test() ->
  ?assertEqual("(123) 456-7890", ?TESTED_MODULE:pretty_print("1234567890")),
  ?assertEqual("(123) 456-7890", ?TESTED_MODULE:pretty_print("11234567890")).

Version data entries

172 entries across 172 versions & 1 rubygems

Version Path
trackler-2.2.1.62 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.61 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.60 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.59 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.58 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.57 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.56 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.55 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.54 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.53 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.52 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.51 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.50 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.49 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.48 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.47 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.46 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.45 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.44 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl
trackler-2.2.1.43 tracks/erlang/exercises/phone-number/test/phone_number_tests.erl