2017-04-10 00:38:30 +00:00
|
|
|
defmodule RDF.SigilsTest do
|
|
|
|
use ExUnit.Case, async: true
|
|
|
|
|
|
|
|
import RDF.Sigils
|
|
|
|
|
|
|
|
doctest RDF.Sigils
|
|
|
|
|
|
|
|
describe "IRI sigil without interpolation" do
|
2017-04-18 01:27:28 +00:00
|
|
|
test "creating an URI" do
|
2017-04-10 00:38:30 +00:00
|
|
|
assert ~I<http://example.com> == RDF.uri("http://example.com")
|
|
|
|
end
|
2017-04-18 01:27:28 +00:00
|
|
|
end
|
2017-04-10 00:38:30 +00:00
|
|
|
|
2017-05-19 15:19:06 +00:00
|
|
|
describe "Blank node sigil without interpolation" do
|
|
|
|
test "creating a blank node" do
|
|
|
|
assert ~B<foo> == RDF.bnode("foo")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-04-18 01:27:28 +00:00
|
|
|
describe "Literal sigil without interpolation" do
|
|
|
|
test "creating a plain Literal" do
|
|
|
|
assert ~L"foo" == RDF.literal("foo")
|
|
|
|
end
|
|
|
|
|
|
|
|
test "creating a language-tagged Literal" do
|
|
|
|
assert ~L"foo"en == RDF.literal("foo", language: "en")
|
|
|
|
end
|
2017-04-10 00:38:30 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|