From 818d4908bdbaa3168e82b8535eeea33f2f8cde05 Mon Sep 17 00:00:00 2001 From: Kip Cole Date: Sun, 7 Jul 2024 20:54:10 +1000 Subject: [PATCH] Add tests for skeleton codes jJc --- test/cldr_dates_times_test.exs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/cldr_dates_times_test.exs b/test/cldr_dates_times_test.exs index f2c77e7..6da612a 100644 --- a/test/cldr_dates_times_test.exs +++ b/test/cldr_dates_times_test.exs @@ -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