Sha256: d3ee9be4d82c9ea2d7cf0856bc967ead9d9ecd488dc78d6d8b68b26719b46ad7

Contents?: true

Size: 999 Bytes

Versions: 304

Compression:

Stored size: 999 Bytes

Contents

;;; hamming-test.el --- Tests for hamming (exercism)

;;; Commentary:

;;; Code:

(load-file "hamming.el")

(ert-deftest no-difference-between-empty-strands ()
  (should (= 0 (hamming-distance "" ""))))

(ert-deftest no-difference-between-identical-strands ()
  (should (= 0 (hamming-distance "GATTACA" "GATTACA"))))

(ert-deftest complete-hamming-distance-in-small-strand ()
  (should (= 3 (hamming-distance "ACT" "GGA"))))

(ert-deftest small-hamming-distance-in-middle-somwhere ()
  (should (= 1 (hamming-distance "GGACG" "GGTCG"))))

(ert-deftest larger-distance ()
  (should (= 2 (hamming-distance "ACCAGGG" "ACTATGG"))))

(ert-deftest invalid-to-get-distance-for-different-length-strings ()
  (should-error (hamming-distance "AGACAACAGCCAGCCGCCGGATT" "AGGCAA"))
  (should-error (hamming-distance
                 "AGACAACAGCCAGCCGCCGGATT" "AGACATCTTTCAGCCGCCGGATTAGGCAA"))
  (should-error (hamming-distance "AGG" "CATCATCATCATCATGAT")))


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

Version data entries

304 entries across 304 versions & 1 rubygems

Version Path
trackler-2.2.1.86 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.85 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.84 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.83 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.82 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.81 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.80 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.79 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.78 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.77 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.76 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.75 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.74 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.73 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.72 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.71 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.70 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.69 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.68 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.67 tracks/elisp/exercises/hamming/hamming-test.el