Skip to content

Instantly share code, notes, and snippets.

@josd
Created September 11, 2020 20:14
Show Gist options
  • Save josd/dbf3209bda4874e13cb2e22a60de6d91 to your computer and use it in GitHub Desktop.
Save josd/dbf3209bda4874e13cb2e22a60de6d91 to your computer and use it in GitHub Desktop.
inf and nan tests
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix : <http://example.org/test#>.
{ "INF"^^xsd:double math:greaterThan 42 } => { :TEST :PASS 1 }.
{ 42 math:lessThan "INF"^^xsd:double } => { :TEST :PASS 2 }.
{ "-INF"^^xsd:double math:lessThan 42 } => { :TEST :PASS 3 }.
{ 42 math:greaterThan "-INF"^^xsd:double } => { :TEST :PASS 4 }.
{ "-INF"^^xsd:double math:lessThan "INF"^^xsd:double } => { :TEST :PASS 5 }.
{ "INF"^^xsd:double math:greaterThan "-INF"^^xsd:double } => { :TEST :PASS 6 }.
{ "-INF"^^xsd:double math:greaterThan 42 } => { :TEST :SHOULDNT_PASS 1 }.
{ 42 math:lessThan "-INF"^^xsd:double } => { :TEST :SHOULDNT_PASS 2 }.
{ "INF"^^xsd:double math:lessThan 42 } => { :TEST :SHOULDNT_PASS 3 }.
{ 42 math:greaterThan "INF"^^xsd:double } => { :TEST :SHOULDNT_PASS 4 }.
{ "NaN"^^xsd:double math:equalTo "NaN"^^xsd:double } => { :TEST :SHOULDNT_PASS 5 }.
{ "NaN"^^xsd:double math:greaterThan 42 } => { :TEST :SHOULDNT_PASS 6 }.
{ "NaN"^^xsd:double math:lessThan 42 } => { :TEST :SHOULDNT_PASS 7 }.
{ 42 math:greaterThan "NaN"^^xsd:double } => { :TEST :SHOULDNT_PASS 8 }.
{ 42 math:lessThan "NaN"^^xsd:double } => { :TEST :SHOULDNT_PASS 9 }.
{ "NaN"^^xsd:double math:lessThan "-INF"^^xsd:double } => { :TEST :SHOULDNT_PASS 10 }.
{ "NaN"^^xsd:double math:greaterThan "-INF"^^xsd:double } => { :TEST :SHOULDNT_PASS 11 }.
{ "NaN"^^xsd:double math:lessThan "INF"^^xsd:double } => { :TEST :SHOULDNT_PASS 12 }.
{ "NaN"^^xsd:double math:greaterThan "INF"^^xsd:double } => { :TEST :SHOULDNT_PASS 13 }.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment