rdf-ex/test/support/rdf_query_test_case.ex
2020-06-29 10:37:42 +02:00

25 lines
547 B
Elixir

defmodule RDF.Query.Test.Case do
use ExUnit.CaseTemplate
using do
quote do
use RDF.Test.Case
alias RDF.Query.BGP
import unquote(__MODULE__)
end
end
alias RDF.Query.BGP
def bgp_struct(), do: %BGP{triple_patterns: []}
def bgp_struct(triple_patterns) when is_list(triple_patterns),
do: %BGP{triple_patterns: triple_patterns}
def bgp_struct({_, _, _} = triple_pattern),
do: %BGP{triple_patterns: [triple_pattern]}
def ok_bgp_struct(triple_patterns), do: {:ok, bgp_struct(triple_patterns)}
end