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