Disable remote-doc test suite

These tests are not about remote context processing,
but remote document loading, which we are not supporting yet.
This commit is contained in:
Marcel Otto 2020-06-19 02:40:57 +02:00
parent 426bc8f56d
commit 891203810f

View file

@ -1,47 +1,57 @@
defmodule JSON.LD.TestSuite.RemoteDocTest do
use ExUnit.Case, async: false
# TODO: These tests are disabled as we don't support remote document loading yet.
import JSON.LD.TestSuite
setup_all do
[base_iri: manifest("remote-doc")["baseIri"]]
end
test_cases("remote-doc")
|> Enum.each(fn %{"name" => name, "input" => input} = test_case ->
if input in ~w[
remote-doc-0005-in.jsonld
remote-doc-0006-in.jsonld
remote-doc-0007-in.jsonld
remote-doc-0008-in.jsonld
] do
@tag skip: "TODO: Missed test file"
end
if input in ~w[
remote-doc-0009-in.jsonld
remote-doc-0010-in.json
remote-doc-0011-in.jldt
remote-doc-0012-in.json
] do
@tag skip: "TODO: Context from Link header is unsupported"
end
@tag :test_suite
@tag :remote_doc_test_suite
@tag data: test_case
case hd(test_case["@type"]) do
"jld:PositiveEvaluationTest" ->
test "#{input}: #{name}",
%{data: %{"input" => input, "expect" => output} = test_case, base_iri: base_iri} do
assert JSON.LD.expand(j(input), test_case_options(test_case, base_iri)) == j(output)
end
"jld:NegativeEvaluationTest" ->
@tag skip: "TODO: "
test "#{input}: #{name}",
%{data: %{"input" => input, "expect" => error} = test_case, base_iri: base_iri} do
end
end
end)
end
#defmodule JSON.LD.TestSuite.RemoteDocTest do
# use ExUnit.Case, async: false
#
# import JSON.LD.TestSuite
#
# setup_all do
# [base_iri: manifest("remote-doc")["baseIri"]]
# end
#
# test_cases("remote-doc")
# |> Enum.each(fn %{"name" => name, "input" => input} = test_case ->
# if input in ~w[
# remote-doc-0005-in.jsonld
# remote-doc-0006-in.jsonld
# remote-doc-0007-in.jsonld
# remote-doc-0008-in.jsonld
# ] do
# @tag skip: "TODO: Missed test file"
# end
#
# if input in ~w[
# remote-doc-0009-in.jsonld
# remote-doc-0010-in.json
# remote-doc-0011-in.jldt
# remote-doc-0012-in.json
# ] do
# @tag skip: "TODO: Context from Link header is unsupported"
# end
#
# @tag :test_suite
# @tag :remote_doc_test_suite
# @tag data: test_case
# case hd(test_case["@type"]) do
# "jld:PositiveEvaluationTest" ->
# test "#{input}: #{name}",
# %{data: %{"input" => input, "expect" => output} = test_case, base_iri: base_iri} do
# assert JSON.LD.expand(j(input), test_case_options(test_case, base_iri)) == j(output)
# end
#
# "jld:NegativeEvaluationTest" ->
# test "#{input}: #{name}",
# %{data: %{"input" => input, "expect" => error} = test_case, base_iri: base_iri} do
# case error do
# "loading document failed" ->
# assert_raise JSON.LD.LoadingRemoteContextFailedError, fn ->
# JSON.LD.expand(j(input), test_case_options(test_case, base_iri))
# end
#
# "multiple context link headers" ->
# # TODO:
# end
# end
# end
# end)
#end