Skip to content

Commit

Permalink
Sync pangram tests and update stub (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras authored Apr 24, 2024
1 parent c711135 commit 177d2fe
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 25 deletions.
57 changes: 34 additions & 23 deletions exercises/practice/pangram/pangram-test.el
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
;;; pagram-test.el --- Tests for Pangram (exercism) -*- lexical-binding: t; -*-
;;; pangram-test.el --- Tests for Pangram (exercism) -*- lexical-binding: t; -*-

;;; Commentary:
;; Common test data version: 1.3.0 d79e13e

;;; Code:


(load-file "pangram.el")
(declare-function pangramp "pangram.el" (phrase))

(ert-deftest sentence-empty ()
(should (equal nil (pangramp ""))))

(ert-deftest recognizes-a-perfect-lower-case-pangram ()
(should (equal t (pangramp "abcdefghijklmnopqrstuvwxyz"))))
(ert-deftest empty-sentence ()
(should-not (pangramp "")))


(ert-deftest perfect-lower-case ()
(should (pangramp "abcdefghijklmnopqrstuvwxyz")))


(ert-deftest only-lower-case ()
(should (pangramp "the quick brown fox jumps over the lazy dog")))


(ert-deftest missing-the-letter-x ()
(should-not (pangramp "a quick movement of the enemy will jeopardize five gunboats")))


(ert-deftest missing-the-letter-h ()
(should-not (pangramp "five boxing wizards jump quickly at it")))


(ert-deftest with-underscores ()
(should (pangramp "the_quick_brown_fox_jumps_over_the_lazy_dog")))


(ert-deftest pangram-with-only-lower-case ()
(should (equal t (pangramp "the quick brown fox jumps over the lazy dog"))))
(ert-deftest with-numbers ()
(should (pangramp "the 1 quick brown fox jumps over the 2 lazy dogs")))

(ert-deftest missing-character-x ()
(should (equal nil (pangramp "a quick movement of the enemy will jeopardize five gunboats"))))

(ert-deftest missing-another-character-eg-h ()
(should (equal nil (pangramp "five boxing wizards jump quickly at it"))))
(ert-deftest missing-letters-replaced-by-numbers ()
(should-not (pangramp "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog")))

(ert-deftest pangram-with-underscores ()
(should (equal t (pangramp "the_quick_brown_fox_jumps_over_the_lazy_dog"))))

(ert-deftest pangram-with-numbers ()
(should (equal t (pangramp "the 1 quick brown fox jumps over the 2 lazy dogs"))))
(ert-deftest mixed-case-and-punctuation ()
(should (pangramp "\"Five quacking Zephyrs jolt my wax bed.\"")))

(ert-deftest missing-letters-replaced-by-numbers ()
(should (equal nil (pangramp "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog"))))

(ert-deftest pangram-with-mixed-case-and-punctuation ()
(should (equal t (pangramp "\"Five quacking Zephyrs jolt my wax bed.\""))))
(ert-deftest a-m-and-A-M-are-26-different-characters-but-not-a-pangram ()
(should-not (pangramp "abcdefghijklm ABCDEFGHIJKLM")))

(ert-deftest a-m-and-A-M-are-26-different-characters-but-not-a-pangram ()
(should (equal nil (pangramp "abcdefghijklm ABCDEFGHIJKLM"))))

(provide 'pangram-test)
;;; pagram-test.el ends here
;;; pangram-test.el ends here
7 changes: 5 additions & 2 deletions exercises/practice/pangram/pangram.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

;;; Commentary:

(defun pangramp (phrase)
;;; Code:
)


(defun pangramp (phrase)
(error "Delete this S-Expression and write your own implementation"))


(provide 'pangram)
;;; pangram.el ends here

0 comments on commit 177d2fe

Please sign in to comment.