Skip to content

Commit 3cd90cb

Browse files
committed
add test case
1 parent dc69c12 commit 3cd90cb

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

resources/testcases/arithmetic/builtins.rls

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ strings("Hello", "World").
55
doubles(2.0E0, 1.5E0, 0.5E0).
66
integers(1, 2, 3).
77
tagged("test"@en).
8-
iri(constant).
9-
null(!V) :- iri(?X).
8+
constant(constant).
9+
null(!V) :- constant(?X).
1010
@import uri_strings :- csv{resource="sources/uri_strings.csv"}.
1111

1212
% Datatype check
@@ -15,7 +15,7 @@ result(isint, ?R) :- integers(?A, _, _), ?R = isInteger(?A).
1515
result(isfloat, ?R) :- doubles(?A, _, _), ?R = isFloat(?A).
1616
result(isdouble, ?R) :- doubles(?A, _, _), ?R = isDouble(?A).
1717
result(isnumeric, ?R) :- integers(?A, _, _), ?R = isNumeric(?A).
18-
result(isiri, ?R) :- iri(?A), ?R = isIri(?A).
18+
result(isiri, ?R) :- constant(?A), ?R = isIri(?A).
1919
result(isnull, ?R) :- null(?A), ?R = isNull(?A).
2020

2121
% String representation
@@ -31,17 +31,19 @@ result(fullstring, ?R) :- tagged(?A), ?R = fullStr(?A).
3131
% Get language tag
3232
result(tag, ?R) :- tagged(?L), ?R = LANG(?L).
3333

34-
% Numeric casts
34+
% Casts
3535
cast(3.0).
3636
cast(4.2).
3737
cast(5).
3838
cast(test).
3939
cast("2023"^^xsd:gYear).
4040
cast("40").
41+
cast("https://example.org").
4142

4243
result(int, ?R) :- cast(?A), ?R = INT(?A).
4344
result(float, ?R) :- cast(?A), ?R = FLOAT(?A).
4445
result(double, ?R) :- cast(?A), ?R = DOUBLE(?A).
46+
result(iri, ?R) :- cast(?A), ?R = IRI(?A).
4547

4648
% Cast within numeric operations
4749

resources/testcases/arithmetic/builtins/result.csv

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ double,"""4.2""^^<http://www.w3.org/2001/XMLSchema#double>"
2626
double,"""5""^^<http://www.w3.org/2001/XMLSchema#double>"
2727
double,"""40""^^<http://www.w3.org/2001/XMLSchema#double>"
2828
double,"""2023""^^<http://www.w3.org/2001/XMLSchema#double>"
29+
iri,https://example.org
30+
iri,40
31+
iri,test
2932
mixedsum,"""6.5""^^<http://www.w3.org/2001/XMLSchema#double>"
3033
round,5
3134
round,"""3""^^<http://www.w3.org/2001/XMLSchema#double>"

0 commit comments

Comments
 (0)