2023-07-15 15:27:31 -07:00
|
|
|
# These tests are auto-generated with test data from:
|
|
|
|
|
# https://github.com/exercism/problem-specifications/tree/main/exercises/isogram/canonical-data.json
|
2023-07-21 16:54:40 -07:00
|
|
|
# File last updated on 2023-07-19
|
2023-07-15 15:27:31 -07:00
|
|
|
|
2017-03-19 13:50:32 +01:00
|
|
|
import unittest
|
2017-04-27 18:10:59 +02:00
|
|
|
|
2021-01-31 16:49:12 -05:00
|
|
|
from isogram import (
|
|
|
|
|
is_isogram,
|
|
|
|
|
)
|
2017-03-19 13:50:32 +01:00
|
|
|
|
|
|
|
|
|
2019-08-05 13:18:51 -04:00
|
|
|
class IsogramTest(unittest.TestCase):
|
2021-05-09 20:10:41 -07:00
|
|
|
def test_empty_string(self):
|
|
|
|
|
self.assertIs(is_isogram(""), True)
|
2017-03-19 13:50:32 +01:00
|
|
|
|
2021-05-09 20:10:41 -07:00
|
|
|
def test_isogram_with_only_lower_case_characters(self):
|
|
|
|
|
self.assertIs(is_isogram("isogram"), True)
|
|
|
|
|
|
|
|
|
|
def test_word_with_one_duplicated_character(self):
|
|
|
|
|
self.assertIs(is_isogram("eleven"), False)
|
|
|
|
|
|
|
|
|
|
def test_word_with_one_duplicated_character_from_the_end_of_the_alphabet(self):
|
|
|
|
|
self.assertIs(is_isogram("zzyzx"), False)
|
|
|
|
|
|
|
|
|
|
def test_longest_reported_english_isogram(self):
|
|
|
|
|
self.assertIs(is_isogram("subdermatoglyphic"), True)
|
|
|
|
|
|
|
|
|
|
def test_word_with_duplicated_character_in_mixed_case(self):
|
|
|
|
|
self.assertIs(is_isogram("Alphabet"), False)
|
|
|
|
|
|
|
|
|
|
def test_word_with_duplicated_character_in_mixed_case_lowercase_first(self):
|
|
|
|
|
self.assertIs(is_isogram("alphAbet"), False)
|
|
|
|
|
|
|
|
|
|
def test_hypothetical_isogrammic_word_with_hyphen(self):
|
|
|
|
|
self.assertIs(is_isogram("thumbscrew-japingly"), True)
|
|
|
|
|
|
|
|
|
|
def test_hypothetical_word_with_duplicated_character_following_hyphen(self):
|
|
|
|
|
self.assertIs(is_isogram("thumbscrew-jappingly"), False)
|
|
|
|
|
|
|
|
|
|
def test_isogram_with_duplicated_hyphen(self):
|
|
|
|
|
self.assertIs(is_isogram("six-year-old"), True)
|
|
|
|
|
|
|
|
|
|
def test_made_up_name_that_is_an_isogram(self):
|
|
|
|
|
self.assertIs(is_isogram("Emily Jung Schwartzkopf"), True)
|
|
|
|
|
|
|
|
|
|
def test_duplicated_character_in_the_middle(self):
|
|
|
|
|
self.assertIs(is_isogram("accentor"), False)
|
|
|
|
|
|
|
|
|
|
def test_same_first_and_last_characters(self):
|
|
|
|
|
self.assertIs(is_isogram("angola"), False)
|
2018-09-11 06:47:07 -07:00
|
|
|
|
2021-11-10 12:52:45 -08:00
|
|
|
def test_word_with_duplicated_character_and_with_two_hyphens(self):
|
|
|
|
|
self.assertIs(is_isogram("up-to-date"), False)
|