Add missing tests for statement_count functions

This commit is contained in:
Marcel Otto 2022-04-05 21:02:43 +02:00
parent d3fa2a4f02
commit d8f436fea1
3 changed files with 15 additions and 0 deletions

View file

@ -1616,6 +1616,11 @@ defmodule RDF.DatasetTest do
assert Enum.count(dataset.graphs) == 1
end
test "statement_count/1" do
assert Dataset.statement_count(dataset()) == 0
assert Dataset.statement_count(Dataset.new(statement())) == 1
end
describe "include?/3" do
test "valid cases" do
dataset =

View file

@ -787,6 +787,11 @@ defmodule RDF.DescriptionTest do
assert Enum.count(desc.predications) == 1
end
test "statement_count/1" do
assert Description.statement_count(Description.new(EX.S)) == 0
assert Description.statement_count(description({EX.p(), EX.O})) == 1
end
describe "include?/3" do
test "valid cases" do
desc =

View file

@ -1283,6 +1283,11 @@ defmodule RDF.GraphTest do
assert Enum.count(graph.descriptions) == 1
end
test "statement_count/1" do
assert Graph.statement_count(graph()) == 0
assert Graph.statement_count(Graph.new(statement())) == 1
end
describe "include?/3" do
test "valid cases" do
graph =