jsonld-ex/test/unit/utils_test.exs
Marcel Otto 9be156100a json_ld: move helper functions into a dedicated JSON.LD.Utils module
and

- add some documentation
- remove top-level expand_iri delegate
2017-03-21 01:01:55 +01:00

21 lines
476 B
Elixir

defmodule JSON.LD.UtilsTest do
use ExUnit.Case
doctest JSON.LD
import JSON.LD.Utils
describe "compact_iri_parts" do
test "returns the prefix and suffix of a compact IRI" do
assert compact_iri_parts("foo:bar") == ["foo", "bar"]
end
test "returns nil on absolute IRIs" do
assert compact_iri_parts("http://example.com/") == nil
end
test "returns nil on blank nodes" do
assert compact_iri_parts("_:bar") == nil
end
end
end