Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exercises/practice/phone-number/.meta/Example.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ let private checkNumberLength (input:string): Result<string, string> =
| 10 -> Ok input
| 11 when input.[0] = '1'-> Ok (input.Substring 1)
| 11 -> Error "11 digits must start with 1"
| a when a > 11 -> Error "more than 11 digits"
| _ -> Error "incorrect number of digits"
| a when a > 11 -> Error "must not be greater than 11 digits"
| _ -> Error "must not be fewer than 10 digits"

let private checkNoneNumericChars (input:string): Result<string, string> =
match input with
Expand Down
10 changes: 10 additions & 0 deletions exercises/practice/phone-number/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ description = "cleans numbers with multiple spaces"

[598d8432-0659-4019-a78b-1c6a73691d21]
description = "invalid when 9 digits"
include = false

[2de74156-f646-42b5-8638-0ef1d8b58bc2]
description = "invalid when 9 digits"
reimplements = "598d8432-0659-4019-a78b-1c6a73691d21"

[57061c72-07b5-431f-9766-d97da7c4399d]
description = "invalid when 11 digits does not start with a 1"
Expand All @@ -32,6 +37,11 @@ description = "valid when 11 digits and starting with 1 even with punctuation"

[c6a5f007-895a-4fc5-90bc-a7e70f9b5cad]
description = "invalid when more than 11 digits"
include = false

[4a1509b7-8953-4eec-981b-c483358ff531]
description = "invalid when more than 11 digits"
reimplements = "c6a5f007-895a-4fc5-90bc-a7e70f9b5cad"

[63f38f37-53f6-4a5f-bd86-e9b404f10a60]
description = "invalid with letters"
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/phone-number/PhoneNumberTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let ``Cleans numbers with multiple spaces`` () =

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Invalid when 9 digits`` () =
let expected: Result<uint64,string> = Error "incorrect number of digits"
let expected: Result<uint64,string> = Error "must not be fewer than 10 digits"
clean "123456789" |> should equal expected

[<Fact(Skip = "Remove this Skip property to run this test")>]
Expand All @@ -42,7 +42,7 @@ let ``Valid when 11 digits and starting with 1 even with punctuation`` () =

[<Fact(Skip = "Remove this Skip property to run this test")>]
let ``Invalid when more than 11 digits`` () =
let expected: Result<uint64,string> = Error "more than 11 digits"
let expected: Result<uint64,string> = Error "must not be greater than 11 digits"
clean "321234567890" |> should equal expected

[<Fact(Skip = "Remove this Skip property to run this test")>]
Expand Down