Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luhn: Update tests to 1.7.0 (1 changed tests, 2 new tests) #900

Merged
merged 1 commit into from
Mar 25, 2020
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
2 changes: 1 addition & 1 deletion exercises/luhn/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: luhn
version: 1.3.0.6
version: 1.7.0.7

dependencies:
- base
Expand Down
18 changes: 15 additions & 3 deletions exercises/luhn/test/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,22 @@ cases = [ Case { description = "single digit strings can not be valid"
, input = "8273 1232 7352 0569"
, expected = False
}
, Case { description = "invalid long number with an even remainder"
, input = "1 2345 6789 1234 5678 9012"
, expected = False
}
, Case { description = "valid number with an even number of digits"
, input = "095 245 88"
, expected = True
}
, Case { description = "valid number with an odd number of spaces"
, input = "234 567 891 234"
, expected = True
}
-- This track is not testing these cases, since we would rather focus on the algorithm,
-- and because it seems strange to be unable to distinguish between well-formed invalid input and malformed input.
Comment on lines 63 to 64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm remarking that the comment above was left by 610ba69.

-- , Case { description = "valid strings with a non-digit included become invalid"
-- , input = "055a 444 285"
-- , Case { description = "valid strings with a non-digit added at the end become invalid"
-- , input = "059a"
-- , expected = False
-- }
-- , Case { description = "valid strings with punctuation included become invalid"
Expand All @@ -78,7 +86,11 @@ cases = [ Case { description = "single digit strings can not be valid"
, input = "091"
, expected = True
}
-- , Case { description = "strings with non-digits is invalid"
-- , Case { description = "using ascii value for non-doubled non-digit isn't allowed"
-- , input = "055b 444 285"
-- , expected = False
-- }
-- , Case { description = "using ascii value for doubled non-digit isn't allowed"
-- , input = ":9"
-- , expected = False
-- }
Expand Down