Skip to content

Commit

Permalink
Add additional tests for to_string/1
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Dec 8, 2024
1 parent eb6b0bb commit 4653ff3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/cldr_chars_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,15 @@ defmodule Cldr.PersonName.CharsTest do

assert string == "Mary Sue"
end

for {name, person_name} <- Cldr.PersonName.Names.names() do
person_name = Macro.escape(person_name)

test "to_string/1 for #{name}" do
attributes = unquote(person_name) |> Map.to_list() |> Keyword.delete(:__struct__)
assert {:ok, person_name} = Cldr.PersonName.new(attributes)
assert is_binary(to_string(person_name))
assert is_binary(Cldr.to_string(person_name))
end
end
end

0 comments on commit 4653ff3

Please sign in to comment.