From 53174000dfaebbe4ecb5b9a89bcf16bea0fdf547 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 21 Feb 2025 13:58:41 +0000 Subject: Add unit tests for lib.functions.parse-integer* --- tests/functions.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/functions.lisp b/tests/functions.lisp index 5d4d05a..ef6b83e 100644 --- a/tests/functions.lisp +++ b/tests/functions.lisp @@ -22,3 +22,11 @@ (define-test function-test :depends-on ((cantedraw/tests/macros macro-test))) + +(define-test (function-test "parse-integer*") + :compile-at :execute + (is eq 2 (parse-integer* "2")) + (is eq 2048 (parse-integer* "2048abcdef")) + (is eq nil (parse-integer* "a2048abcdef")) + (is eq nil (parse-integer* "garbage")) + (fail (parse-integer* nil))) -- cgit v1.2.3-13-gbd6f