Sha256: 47f6314e0fc83271142765bdefec0d6b18088ccb4e79e1fc30bf3ebbe3f8f5b1

Contents?: true

Size: 819 Bytes

Versions: 396

Compression:

Stored size: 819 Bytes

Contents

;;; binary-test.el --- Tests for Binary exercise (exercism)

;;; Commentary:

;;; Code:

(load-file "binary.el")

(ert-deftest binary-1-is-decimal-1 ()
  (should (= 1 (to-decimal "1"))))

(ert-deftest binary-10-is-decimal-2 ()
  (should (= 2 (to-decimal "10"))))

(ert-deftest binary-11-is-decimal-3 ()
  (should (= 3 (to-decimal "11"))))

(ert-deftest binary-100-is-decimal-4 ()
  (should (= 4 (to-decimal "100"))))

(ert-deftest binary-1001-is-decimal-9 ()
  (should (= 9 (to-decimal "1001"))))

(ert-deftest binary-11010-is-decimal-26 ()
  (should (= 26 (to-decimal "11010"))))

(ert-deftest binary-10001101000-is-decimal-1128 ()
  (should (= 1128 (to-decimal "10001101000"))))

(ert-deftest invalid-binary-is-decimal-0 ()
  (should (= 0 (to-decimal "carrot"))))

(provide 'binary-test)
;;; binary-test.el ends here

Version data entries

396 entries across 396 versions & 1 rubygems

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