Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync pangram tests #358

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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