Skip to content

Commit d896ddf

Browse files
committed
Tweak pangram tests per canonical-data
This removes an include=false from the tests.toml, as the exclusion seems to have been unintentional (the new test passes with no changes to the example solution). It also switches to use the should.be_false / should.be_true style that other tests use, rather than assert False / assert True.
1 parent babe1e6 commit d896ddf

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"authors": [
33
"lpil"
44
],
5+
"contributors": [
6+
"kytrinyx"
7+
],
58
"files": {
69
"solution": [
710
"src/pangram.gleam"

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ description = "mixed case and punctuation"
3838

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

4342
[7138e389-83e4-4c6e-8413-1e40a0076951]
4443
description = "a-m and A-M are 26 different characters but not a pangram"
Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,73 @@
11
import pangram.{is_pangram}
22
import gleeunit
3+
import gleeunit/should
34

45
pub fn main() {
56
gleeunit.main()
67
}
78

89
pub fn empty_sentence_test() {
910
let sentence = ""
10-
assert False = is_pangram(sentence)
11+
is_pangram(sentence)
12+
|> should.be_false
1113
}
1214

1315
pub fn perfect_lower_case_test() {
1416
let sentence = "abcdefghijklmnopqrstuvwxyz"
15-
assert True = is_pangram(sentence)
17+
is_pangram(sentence)
18+
|> should.be_true
1619
}
1720

1821
pub fn only_lower_case_test() {
1922
let sentence = "the quick brown fox jumps over the lazy dog"
20-
assert True = is_pangram(sentence)
23+
is_pangram(sentence)
24+
|> should.be_true
2125
}
2226

2327
pub fn missing_the_letter_x_test() {
2428
let sentence = "a quick movement of the enemy will jeopardize five gunboats"
25-
assert False = is_pangram(sentence)
29+
is_pangram(sentence)
30+
|> should.be_false
2631
}
2732

2833
pub fn missing_the_letter_h_test() {
2934
let sentence = "five boxing wizards jump quickly at it"
30-
assert False = is_pangram(sentence)
35+
is_pangram(sentence)
36+
|> should.be_false
3137
}
3238

3339
pub fn with_underscores_test() {
3440
let sentence = "the_quick_brown_fox_jumps_over_the_lazy_dog"
35-
assert True = is_pangram(sentence)
41+
is_pangram(sentence)
42+
|> should.be_true
3643
}
3744

3845
pub fn with_numbers_test() {
3946
let sentence = "the 1 quick brown fox jumps over the 2 lazy dogs"
40-
assert True = is_pangram(sentence)
47+
is_pangram(sentence)
48+
|> should.be_true
4149
}
4250

4351
pub fn missing_letters_replaced_by_numbers_test() {
4452
let sentence = "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog"
45-
assert False = is_pangram(sentence)
53+
is_pangram(sentence)
54+
|> should.be_false
4655
}
4756

4857
pub fn mixed_case_and_punctuation_test() {
49-
let sentence = "Five quacking Zephyrs jolt my wax bed."
50-
assert True = is_pangram(sentence)
58+
let sentence = "\"Five quacking Zephyrs jolt my wax bed.\""
59+
is_pangram(sentence)
60+
|> should.be_true
5161
}
5262

5363
pub fn case_insensitive_test() {
5464
let sentence = "the quick brown fox jumps over with lazy FX"
55-
assert False = is_pangram(sentence)
65+
is_pangram(sentence)
66+
|> should.be_false
5667
}
5768

58-
pub fn a_m_and_upper_a_m_are_26_different_characters_but_not_a_pangram_test() {
69+
pub fn a_m_and_a_m_are_26_different_characters_but_not_a_pangram_test() {
5970
let sentence = "abcdefghijklm ABCDEFGHIJKLM"
60-
assert False = is_pangram(sentence)
71+
is_pangram(sentence)
72+
|> should.be_false
6173
}

0 commit comments

Comments
 (0)