From ff7dbec262dc0cb8c22113d2c6fcda31159b030b Mon Sep 17 00:00:00 2001 From: RayPals Date: Mon, 1 Jun 2026 00:52:33 +0200 Subject: [PATCH] Add tests/19_stdlib_math_random_csv.claro from Claro v1.17.26 zip --- tests/19_stdlib_math_random_csv.claro | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/19_stdlib_math_random_csv.claro diff --git a/tests/19_stdlib_math_random_csv.claro b/tests/19_stdlib_math_random_csv.claro new file mode 100644 index 0000000..0de953d --- /dev/null +++ b/tests/19_stdlib_math_random_csv.claro @@ -0,0 +1,27 @@ +IMPORT "lib/math.claro" AS math +IMPORT "lib/random.claro" AS random +IMPORT "lib/csv.claro" AS csv + +CALL math.abs WITH -5 +SAY RESULT +CALL math.clamp WITH 15, 0, 10 +SAY RESULT + +CALL random.seed WITH 123 +CALL random.int WITH 1, 10 +SET r TO RESULT +IF (r >= 1) AND (r <= 10) + SAY "OK" +ELSE + SAY "BAD" +ENDIF + +SET t TO "a,b\n1,2\n" +CALL csv.read WITH t, "," +SET rows TO RESULT +GET rows AT 1 AS r1 +GET r1 AT 2 AS f +SAY f + +CALL csv.write WITH rows, "," +SAY RESULT