Skip to content

Commit 86f4b32

Browse files
committed
Adjust quote/2 test cases
1 parent 07028f6 commit 86f4b32

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

lib/cldr.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,11 +1280,11 @@ defmodule Cldr do
12801280
12811281
## Examples
12821282
1283-
iex> Cldr.quote("Quoted String", MyApp.Cldr)
1283+
iex> Cldr.quote("Quoted String", MyApp.Cldr, locale: :en)
12841284
"“Quoted String”"
12851285
1286-
iex> Cldr.quote("Quoted String", MyApp.Cldr, prefer: :variant)
1287-
"Quoted String"
1286+
iex> Cldr.quote("Quoted String", MyApp.Cldr, prefer: :variant, locale: :de)
1287+
"Quoted String"
12881288
12891289
iex> Cldr.quote("Quoted String", MyApp.Cldr, locale: "ja")
12901290
"「Quoted String」"

lib/cldr/backend/cldr_backend.ex

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,11 @@ defmodule Cldr.Backend do
471471
472472
## Examples
473473
474-
iex> #{inspect(__MODULE__)}.quote("Quoted String")
474+
iex> #{inspect(__MODULE__)}.quote("Quoted String", locale: :en)
475475
"“Quoted String”"
476476
477-
iex> #{inspect(__MODULE__)}.quote("Quoted String", prefer: :variant)
478-
"Quoted String"
477+
iex> #{inspect(__MODULE__)}.quote("Quoted String", prefer: :variant, locale: :de)
478+
"Quoted String"
479479
480480
iex> #{inspect(__MODULE__)}.quote("Quoted String", locale: :ja)
481481
"「Quoted String」"
@@ -508,11 +508,7 @@ defmodule Cldr.Backend do
508508
# a map entry of :default.
509509

510510
defp quote_preference(marks, preference) do
511-
if is_binary(marks) do
512-
marks
513-
else
514-
Map.get(marks, preference) || Map.fetch!(marks, :default)
515-
end
511+
Map.get(marks, preference) || Map.fetch!(marks, :default)
516512
end
517513

518514

0 commit comments

Comments
 (0)