Sha256: 08239e90628d124ec6d3a5409fce77d492c2b8783266cec14505e27d84385e8c
Contents?: true
Size: 770 Bytes
Versions: 100
Compression:
Stored size: 770 Bytes
Contents
(ns collatz-conjecture-test (:require [clojure.test :refer [deftest is testing]] [collatz-conjecture :refer [collatz]])) (deftest steps-for-1 (testing "zero steps for one" (is (= 0 (collatz 1))))) (deftest steps-for-16 (testing "divide if even" (is (= 4 (collatz 16))))) (deftest steps-for-12 (testing "even and odd steps" (is (= 9 (collatz 12))))) (deftest steps-for-1000000 (testing "Large number of even and odd steps" (is (= 152 (collatz 1000000))))) (deftest steps-for-0 (testing "zero is an error" (is (thrown? IllegalArgumentException (collatz 0))))) (deftest steps-for-negative (testing "negative value is an error" (is (thrown? IllegalArgumentException (collatz -15)))))
Version data entries
100 entries across 100 versions & 1 rubygems