You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
690 B
26 lines
690 B
(ns cipher-analytical-machine.parsers.parsers-test
|
|
(:require
|
|
[clojure.test :refer :all]
|
|
[cipher-analytical-machine.parsers.parsers :refer :all]))
|
|
|
|
(deftest unsigned-int?-test
|
|
(testing "The function return true only for an unsingned integer as a string."
|
|
(are [str expected]
|
|
(= expected
|
|
(unsigned-int? str))
|
|
"9" true
|
|
"10" true
|
|
"-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]
|
|
(= expected
|
|
(parse-unsigned-int str-or-int))
|
|
"9" 9
|
|
9 9
|
|
"10" 10
|
|
"-10" nil
|
|
"abc" nil)))
|