|
|
@ -4,7 +4,7 @@
|
|
|
|
[cipher-analytical-machine.parsers.parsers :refer :all]))
|
|
|
|
[cipher-analytical-machine.parsers.parsers :refer :all]))
|
|
|
|
|
|
|
|
|
|
|
|
(deftest unsigned-int?-test
|
|
|
|
(deftest unsigned-int?-test
|
|
|
|
(testing ""
|
|
|
|
(testing "The function return true only for an unsingned integer as a string."
|
|
|
|
(are [str expected]
|
|
|
|
(are [str expected]
|
|
|
|
(= expected
|
|
|
|
(= expected
|
|
|
|
(unsigned-int? str))
|
|
|
|
(unsigned-int? str))
|
|
|
@ -13,3 +13,13 @@
|
|
|
|
"-10" false
|
|
|
|
"-10" false
|
|
|
|
"abc" 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]
|
|
|
|
|
|
|
|
(= expected
|
|
|
|
|
|
|
|
(parse-unsigned-int str-or-int))
|
|
|
|
|
|
|
|
"9" 9
|
|
|
|
|
|
|
|
9 9
|
|
|
|
|
|
|
|
"10" 10
|
|
|
|
|
|
|
|
"-10" nil
|
|
|
|
|
|
|
|
"abc" nil)))
|
|
|
|