Skip to content

Commit

Permalink
Add tests for skeleton codes jJc
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Jul 7, 2024
1 parent 9f9f156 commit 818d490
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/cldr_dates_times_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,17 @@ defmodule Cldr.DatesTimes.Test do
assert {:ok, "2024/7/6 CE"} = Cldr.Date.to_string(~D[2024-07-06], era: :variant, format: "y/M/d G")
assert {:ok, "2024/7/6 AD"} = Cldr.Date.to_string(~D[2024-07-06], format: "y/M/d G")
end

test "Resolving with skeleton code c, J and j" do
assert {:ok, "10:48 AM"} = Cldr.Time.to_string(~T[10:48:00], format: :hmj)
assert {:ok, "10:48 AM"} = Cldr.Time.to_string(~T[10:48:00], format: :hmJ)

assert Cldr.Date.to_string(~T[10:48:00], format: :hmc) ==
{:error,
{Cldr.DateTime.UnresolvedFormat, "No available format resolved for :hmc"}}

assert Cldr.Time.to_string(~T[10:48:00], format: :hme) ==
{:error,
{Cldr.DateTime.UnresolvedFormat, "No available format resolved for :hme"}}
end
end

0 comments on commit 818d490

Please sign in to comment.