-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
28 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
"authors": [ | ||
"lpil" | ||
], | ||
"contributors": [ | ||
"kytrinyx" | ||
], | ||
"files": { | ||
"solution": [ | ||
"src/pangram.gleam" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,73 @@ | ||
import pangram.{is_pangram} | ||
import gleeunit | ||
import gleeunit/should | ||
|
||
pub fn main() { | ||
gleeunit.main() | ||
} | ||
|
||
pub fn empty_sentence_test() { | ||
let sentence = "" | ||
assert False = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_false | ||
} | ||
|
||
pub fn perfect_lower_case_test() { | ||
let sentence = "abcdefghijklmnopqrstuvwxyz" | ||
assert True = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_true | ||
} | ||
|
||
pub fn only_lower_case_test() { | ||
let sentence = "the quick brown fox jumps over the lazy dog" | ||
assert True = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_true | ||
} | ||
|
||
pub fn missing_the_letter_x_test() { | ||
let sentence = "a quick movement of the enemy will jeopardize five gunboats" | ||
assert False = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_false | ||
} | ||
|
||
pub fn missing_the_letter_h_test() { | ||
let sentence = "five boxing wizards jump quickly at it" | ||
assert False = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_false | ||
} | ||
|
||
pub fn with_underscores_test() { | ||
let sentence = "the_quick_brown_fox_jumps_over_the_lazy_dog" | ||
assert True = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_true | ||
} | ||
|
||
pub fn with_numbers_test() { | ||
let sentence = "the 1 quick brown fox jumps over the 2 lazy dogs" | ||
assert True = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_true | ||
} | ||
|
||
pub fn missing_letters_replaced_by_numbers_test() { | ||
let sentence = "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog" | ||
assert False = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_false | ||
} | ||
|
||
pub fn mixed_case_and_punctuation_test() { | ||
let sentence = "Five quacking Zephyrs jolt my wax bed." | ||
assert True = is_pangram(sentence) | ||
let sentence = "\"Five quacking Zephyrs jolt my wax bed.\"" | ||
is_pangram(sentence) | ||
|> should.be_true | ||
} | ||
|
||
pub fn case_insensitive_test() { | ||
let sentence = "the quick brown fox jumps over with lazy FX" | ||
assert False = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_false | ||
} | ||
|
||
pub fn a_m_and_upper_a_m_are_26_different_characters_but_not_a_pangram_test() { | ||
pub fn a_m_and_a_m_are_26_different_characters_but_not_a_pangram_test() { | ||
let sentence = "abcdefghijklm ABCDEFGHIJKLM" | ||
assert False = is_pangram(sentence) | ||
is_pangram(sentence) | ||
|> should.be_false | ||
} |