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

pangram: Sync tests #701

Merged
merged 5 commits into from
Jan 11, 2025
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
3 changes: 2 additions & 1 deletion exercises/practice/pangram/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"haus",
"sjwarner-bp",
"tstirrat15",
"yurrriq"
"yurrriq",
"tasxatzial"
],
"files": {
"solution": [
Expand Down
18 changes: 15 additions & 3 deletions exercises/practice/pangram/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[64f61791-508e-4f5c-83ab-05de042b0149]
description = "empty sentence"
Expand Down Expand Up @@ -31,3 +38,8 @@ description = "mixed case and punctuation"

[2577bf54-83c8-402d-a64b-a2c0f7bb213a]
description = "case insensitive"
include = false

[7138e389-83e4-4c6e-8413-1e40a0076951]
description = "a-m and A-M are 26 different characters but not a pangram"
reimplements = "2577bf54-83c8-402d-a64b-a2c0f7bb213a"
8 changes: 5 additions & 3 deletions exercises/practice/pangram/src/pangram.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(ns pangram)

(defn pangram? [] ;; <- arglist goes here
;; your code goes here
)
(defn pangram?
"Returns true if the given string is a pangram; otherwise, returns false"
[s]
;; function body
)
61 changes: 33 additions & 28 deletions exercises/practice/pangram/test/pangram_test.clj
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
(ns pangram-test
(:require [clojure.test :refer [is deftest]]
[pangram :refer [pangram?]]))
(:require [clojure.test :refer [deftest testing is]]
pangram))

(deftest empty-sentence
(is (false? (pangram? ""))))
(deftest pangram?_test_1
(testing "empty sentence"
(is (false? (pangram/pangram? "")))))

(deftest lowercase-pangram
(is (pangram? "the quick brown fox jumps over the lazy dog")))
(deftest pangram?_test_2
(testing "perfect lower case"
(is (true? (pangram/pangram? "abcdefghijklmnopqrstuvwxyz")))))

(deftest missing-character-x
(is
(false?
(pangram? "a quick movement of the enemy will jeopardize five gunboats"))))
(deftest pangram?_test_3
(testing "only lower case"
(is (true? (pangram/pangram? "the quick brown fox jumps over the lazy dog")))))

(deftest another-missing-character-x
(is
(false?
(pangram? "the quick brown fish jumps over the lazy dog"))))
(deftest pangram?_test_4
(testing "missing the letter 'x'"
(is (false? (pangram/pangram? "a quick movement of the enemy will jeopardize five gunboats")))))

(deftest with-underscores
(is (pangram? "the_quick_brown_fox_jumps_over_the_lazy_dog")))
(deftest pangram?_test_5
(testing "missing the letter 'h'"
(is (false? (pangram/pangram? "five boxing wizards jump quickly at it")))))

(deftest with-numbers
(is (pangram? "the 1 quick brown fox jumps over the 2 lazy dogs")))
(deftest pangram?_test_6
(testing "with underscores"
(is (true? (pangram/pangram? "the_quick_brown_fox_jumps_over_the_lazy_dog")))))

(deftest missing-letters-replaced-by-numbers
(is
(false?
(pangram? "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog"))))
(deftest pangram?_test_7
(testing "with numbers"
(is (true? (pangram/pangram? "the 1 quick brown fox jumps over the 2 lazy dogs")))))

(deftest mixed-case-and-punctuation
(is (pangram? "\"Five quacking Zephyrs jolt my wax bed.\"")))
(deftest pangram?_test_8
(testing "missing letters replaced by numbers"
(is (false? (pangram/pangram? "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog")))))

(deftest upper-and-lower-not-counted-separately
(is
(false?
(pangram? "the quick brown fox jumps over with lazy FX"))))
(deftest pangram?_test_9
(testing "mixed case and punctuation"
(is (true? (pangram/pangram? "\"Five quacking Zephyrs jolt my wax bed.\"")))))

(deftest pangram?_test_10
(testing "a-m and A-M are 26 different characters but not a pangram"
(is (false? (pangram/pangram? "abcdefghijklm ABCDEFGHIJKLM")))))