Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
aannleax committed Dec 9, 2024
1 parent dafffd0 commit e1e043f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resources/testcases/arithmetic/builtins.rls
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ result(stringstarts_false, ?R) :- strings(_, ?B), ?R = STRSTARTS(?B, "Hell").
result(stringends_true, ?R) :- strings(?A, _), ?R = STRENDS(?A, "ello").
result(stringends_false, ?R) :- strings(_, ?B), ?R = STRENDS(?B, "ello").

% F-string literal
result(fstring_basic, ?R) :- strings(?A, ?B), ?R = f"{?A} and {?B}".
result(fstring_arithmetic, ?R) :- strings(?A, ?B), ?R = f"len*10={STRLEN(?A) * 10}".

% Numeric arithmetic
result(calculation, ?R) :- doubles(?A, ?B, ?C), ?R = POW((?A + ?B + ?C) / 2E0, 3E0) * LOG(16E0, 4E0) + SIN(?C + 0.023599E0) * SQRT(16E0).
result(remainder, ?R) :- integers(_, ?A, ?B), ?R = REM(?B, ?A).
Expand Down
2 changes: 2 additions & 0 deletions resources/testcases/arithmetic/builtins/result.csv
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ max,"""2""^^<http://www.w3.org/2001/XMLSchema#double>"
bitand,0
bitor,3
bitxor,0
fstring_basic,"""Hello and World"""
fstring_arithmetic,"""len*10=50"""

0 comments on commit e1e043f

Please sign in to comment.