We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 16b6d3f commit 9310ec5Copy full SHA for 9310ec5
lib/ltree.ex
@@ -66,6 +66,7 @@ defmodule Hierarch.LTree do
66
@doc """
67
Join list into a string path
68
"""
69
+ def join([]), do: nil
70
def join(list) when is_list(list) do
71
Enum.join(list, @separator)
72
end
test/ltree_test.exs
@@ -50,4 +50,12 @@ defmodule Hierarch.LtreeTest do
50
assert ["Top", "Science"] == LTree.split("Top.Science")
51
52
53
+
54
+ describe "concat/1" do
55
+ test "works" do
56
+ assert nil == LTree.concat(nil, nil)
57
+ assert nil == LTree.concat(nil, "")
58
+ assert "Top.Science" == LTree.concat("Top.Science", nil)
59
+ end
60
61
0 commit comments