Sha256: 1934ccd3779c6f81c53702ca09c852cd02d9de868b9d7a5ac514dc3374da3e0d

Contents?: true

Size: 1.16 KB

Versions: 396

Compression:

Stored size: 1.16 KB

Contents

(ns trinary-test
  (:require [clojure.test :refer [deftest is testing]]
            [trinary :refer [to-decimal]]))

(deftest trinary-1-is-decimal-1
  (testing "1 should still be 1"
    (is (= 1 (to-decimal "1")))))

(deftest trinary-2-is-decimal-2
  (testing "2 should still be 2"
    (is (= 2 (to-decimal "2")))))

(deftest trinary-10-is-decimal-3
  (testing "10 should be 3"
    (is (= 3 (to-decimal "10")))))

(deftest trinary-11-is-decimal-4
  (testing "11 should be 4"
    (is (= 4 (to-decimal "11")))))

(deftest trinary-100-is-decimal-9
  (testing "100 should be 9"
    (is (= 9 (to-decimal "100")))))

(deftest trinary-112-is-decimal-14
  (testing "112 should be 14"
    (is (= 14 (to-decimal "112")))))

(deftest trinary-222-is-decimal-26
  (testing "222 should be 26"
    (is (= 26 (to-decimal "222")))))

(deftest trinary-1122000120-is-decimal-32091
  (testing "1122000120 should be 32091"
    (is (= 32091 (to-decimal "1122000120")))))

(deftest invalid-input-is-decimal-0
  (testing "carrot should be invalid"
    (is (= 0 (to-decimal "carrot")))))

(deftest invalid-input-with-digits-is-decimal-0
  (testing "0a1b2c should be 0"
    (is (= 0 (to-decimal "0a1b2c")))))

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.179 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.178 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.177 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.176 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.175 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.174 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.173 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.172 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.171 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.170 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.169 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.167 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.166 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.165 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.164 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.163 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.162 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.161 tracks/clojure/exercises/trinary/test/trinary_test.clj
trackler-2.2.1.160 tracks/clojure/exercises/trinary/test/trinary_test.clj