Add forgotten equality tests for string literals

This commit is contained in:
Marcel Otto 2018-06-08 19:45:57 +02:00
parent d838424478
commit 0b45e06cf3

View file

@ -59,6 +59,32 @@ defmodule RDF.EqualityTest do
test "incomparability", do: assert_incomparable @incomparable_bnodes
end
describe "RDF.String and RDF.LangString" do
@term_equal_strings [
{RDF.string("foo"), RDF.string("foo")},
{RDF.lang_string("foo", language: "de"), RDF.lang_string("foo", language: "de")},
]
@term_unequal_strings [
{RDF.string("foo"), RDF.string("bar")},
{RDF.lang_string("foo", language: "de"), RDF.lang_string("bar", language: "de")},
]
@value_equal_strings [
]
@value_unequal_strings [
]
@incomparable_strings [
{RDF.string("foo"), RDF.lang_string("foo", language: "de")},
{RDF.lang_string("foo", language: "de"), RDF.string("foo")},
{RDF.string("foo"), RDF.bnode("foo")},
]
test "term equality", do: assert_term_equal @term_equal_strings
test "term inequality", do: assert_term_unequal @term_unequal_strings
test "value equality", do: assert_value_equal @value_equal_strings
test "value inequality", do: assert_value_unequal @value_unequal_strings
test "incomparability", do: assert_incomparable @incomparable_strings
end
describe "RDF.Boolean" do
@term_equal_booleans [
{RDF.true, RDF.true},