From 8b14625231e4106dcd8409944cdc1c11a6fbe1a6 Mon Sep 17 00:00:00 2001 From: Alex Ivliev Date: Mon, 9 Dec 2024 10:07:56 +0100 Subject: [PATCH] Add integration test --- resources/testcases/arithmetic/builtins.rls | 4 ++++ resources/testcases/arithmetic/builtins/result.csv | 2 ++ 2 files changed, 6 insertions(+) diff --git a/resources/testcases/arithmetic/builtins.rls b/resources/testcases/arithmetic/builtins.rls index 6291de4f..64222c56 100644 --- a/resources/testcases/arithmetic/builtins.rls +++ b/resources/testcases/arithmetic/builtins.rls @@ -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). diff --git a/resources/testcases/arithmetic/builtins/result.csv b/resources/testcases/arithmetic/builtins/result.csv index 36351957..ba47af49 100644 --- a/resources/testcases/arithmetic/builtins/result.csv +++ b/resources/testcases/arithmetic/builtins/result.csv @@ -60,3 +60,5 @@ max,"""2""^^" bitand,0 bitor,3 bitxor,0 +fstring_basic,"""Hello and World""" +fstring_arithmetic,"""len*10=50""" \ No newline at end of file