Skip to content

Commit b87ea61

Browse files
committed
Join pre-release parts with "."
Signed-off-by: Eric Meadows-Jönsson <[email protected]>
1 parent c355ab6 commit b87ea61

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/elixir/lib/version.ex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,11 @@ defimpl String.Chars, for: Version do
529529
end
530530

531531
defp pre(pre) do
532-
Enum.map(["-"] ++ pre, fn
533-
int when is_integer(int) -> Integer.to_string(int)
534-
string when is_binary(string) -> string
535-
end)
532+
"-" <>
533+
Enum.map_join(pre, ".", fn
534+
int when is_integer(int) -> Integer.to_string(int)
535+
string when is_binary(string) -> string
536+
end)
536537
end
537538
end
538539

lib/elixir/test/elixir/version_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ defmodule VersionTest do
7373
assert V.parse("1.0.0+lol") |> elem(1) |> to_string == "1.0.0+lol"
7474
assert V.parse("1.0.0-dev+lol") |> elem(1) |> to_string == "1.0.0-dev+lol"
7575
assert V.parse("1.0.0-0") |> elem(1) |> to_string == "1.0.0-0"
76+
assert V.parse("1.0.0-rc.0") |> elem(1) |> to_string == "1.0.0-rc.0"
7677
end
7778

7879
test "invalid match" do

0 commit comments

Comments
 (0)