It turned out that the costs of separating the XSD datatypes are too high and probably not worth the effort, since with its limited scope probably nobody would want to use XSD.ex outside of the RDF.ex context anyway.
17 lines
490 B
Elixir
17 lines
490 B
Elixir
defmodule RDF.XSDTest do
|
|
use RDF.Test.Case
|
|
|
|
doctest RDF.XSD
|
|
|
|
test "Datatype constructor alias functions" do
|
|
Enum.each(XSD.datatypes(), fn datatype ->
|
|
assert apply(XSD, String.to_atom(datatype.name), [1]) == datatype.new(1)
|
|
assert apply(XSD, String.to_atom(Macro.underscore(datatype.name)), [1]) == datatype.new(1)
|
|
end)
|
|
end
|
|
|
|
test "true and false aliases" do
|
|
assert XSD.true == XSD.Boolean.new(true)
|
|
assert XSD.false == XSD.Boolean.new(false)
|
|
end
|
|
end
|