Sha256: 3c53280ddad089812b9f97028810f0366e3fe07ba62e9def02c335e4008cc3a6

Contents?: true

Size: 1.17 KB

Versions: 73

Compression:

Stored size: 1.17 KB

Contents

import unittest

from isogram import is_isogram


# test cases adapted from `x-common//canonical-data.json` @ version: 1.1.0

class TestIsogram(unittest.TestCase):

    def test_empty_string(self):
        self.assertTrue(is_isogram(""))

    def test_isogram_with_only_lower_case_characters(self):
        self.assertTrue(is_isogram("isogram"))

    def test_word_with_one_duplicated_character(self):
        self.assertFalse(is_isogram("eleven"))

    def test_longest_reported_english_isogram(self):
        self.assertTrue(is_isogram("subdermatoglyphic"))

    def test_word_with_duplicated_character_in_mixed_case(self):
        self.assertFalse(is_isogram("Alphabet"))

    def test_hypothetical_isogrammic_word_with_hyphen(self):
        self.assertTrue(is_isogram("thumbscrew-japingly"))

    def test_isogram_with_duplicated_non_letter_character(self):
        self.assertTrue(is_isogram("Hjelmqvist-Gryb-Zock-Pfund-Wax"))

    def test_made_up_name_that_is_an_isogram(self):
        self.assertTrue(is_isogram("Emily Jung Schwartzkopf"))

    def test_duplicated_character_in_the_middle(self):
        self.assertFalse(is_isogram("accentor"))


if __name__ == '__main__':
    unittest.main()

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
trackler-2.1.0.36 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.34 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.33 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.32 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.31 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.30 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.29 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.28 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.27 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.26 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.25 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.24 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.23 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.22 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.21 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.20 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.19 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.18 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.17 tracks/python/exercises/isogram/isogram_test.py
trackler-2.1.0.16 tracks/python/exercises/isogram/isogram_test.py