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

Fix spec for known_territory_subdivision #39

Conversation

richard-ash
Copy link
Contributor

{:ok, nil} is a valid response and not covered by the existing spec. Here I update the spec to account for this case.

There's an argument that maybe the library should return {:ok, []} when there are no known subdivisions for a valid territory. But as the {:ok, nil} was already the tested result I went with just updating the spec.

Reproduce:

iex(8)> Cldr.Territory.known_territory_subdivisions(:AI)
{:ok, nil}

lib/cldr/backend.ex Outdated Show resolved Hide resolved
`{:ok, nil}` is a valid response and not covered by the existing spec. Here I update the spec to account for this case.

There's an argument that maybe the library should return `{:ok, []}` when there are no known subdivisions for a valid territory. But as the `{:ok, nil}` was already the tested result I went with just updating the spec.
@richard-ash richard-ash force-pushed the richard/update-known-subdivision-spec branch from dd0134d to 7f3cfde Compare March 17, 2024 21:12
Copy link
Collaborator

@Schultzer Schultzer left a comment

Choose a reason for hiding this comment

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

Awesome ❤️ 🚀 💜

@Schultzer Schultzer merged commit 1d0fdb8 into elixir-cldr:master Mar 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants