Skip to content

Commit 17031f9

Browse files
authoredJan 11, 2025··
pangram: Sync tests (#701)
* update starter file * sync tests * implement tests * update config * rename test functions, make test descriptions identical to the ones from .toml [no important files changed]
1 parent 6e1f0b0 commit 17031f9

File tree

4 files changed

+55
-35
lines changed

4 files changed

+55
-35
lines changed
 

‎exercises/practice/pangram/.meta/config.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"haus",
88
"sjwarner-bp",
99
"tstirrat15",
10-
"yurrriq"
10+
"yurrriq",
11+
"tasxatzial"
1112
],
1213
"files": {
1314
"solution": [

‎exercises/practice/pangram/.meta/tests.toml

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

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

3239
[2577bf54-83c8-402d-a64b-a2c0f7bb213a]
3340
description = "case insensitive"
41+
include = false
42+
43+
[7138e389-83e4-4c6e-8413-1e40a0076951]
44+
description = "a-m and A-M are 26 different characters but not a pangram"
45+
reimplements = "2577bf54-83c8-402d-a64b-a2c0f7bb213a"
+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
(ns pangram)
22

3-
(defn pangram? [] ;; <- arglist goes here
4-
;; your code goes here
5-
)
3+
(defn pangram?
4+
"Returns true if the given string is a pangram; otherwise, returns false"
5+
[s]
6+
;; function body
7+
)
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
11
(ns pangram-test
2-
(:require [clojure.test :refer [is deftest]]
3-
[pangram :refer [pangram?]]))
2+
(:require [clojure.test :refer [deftest testing is]]
3+
pangram))
44

5-
(deftest empty-sentence
6-
(is (false? (pangram? ""))))
5+
(deftest pangram?_test_1
6+
(testing "empty sentence"
7+
(is (false? (pangram/pangram? "")))))
78

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

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

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

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

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

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

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

35-
(deftest upper-and-lower-not-counted-separately
36-
(is
37-
(false?
38-
(pangram? "the quick brown fox jumps over with lazy FX"))))
37+
(deftest pangram?_test_9
38+
(testing "mixed case and punctuation"
39+
(is (true? (pangram/pangram? "\"Five quacking Zephyrs jolt my wax bed.\"")))))
40+
41+
(deftest pangram?_test_10
42+
(testing "a-m and A-M are 26 different characters but not a pangram"
43+
(is (false? (pangram/pangram? "abcdefghijklm ABCDEFGHIJKLM")))))

0 commit comments

Comments
 (0)
Please sign in to comment.