Add int-string? to check if a string is a number.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-11-01 15:02:44 +02:00
parent 91dc00ea0d
commit e145382570
2 changed files with 18 additions and 0 deletions
@@ -16,6 +16,18 @@
"-10" false
"abc" false)))
(deftest int-string?-test
(testing "The function return true only for an singned integer as a string."
(are [str expected]
(= expected
(int-string? str))
"9" true
"10" true
"-10" true
"asd -10 " false
" -10 " false
"abc" false)))
(deftest parse-unsigned-int-test
(testing "The function parse the integer if the string is an integer."
(are [str-or-int expected]