* Corrected small typos around resistor bands. * Due to failing CI, alterations to the test generator script were needed. The generated vs submitted diff now skips the first three lines of the file so that the generation date is not picked up and flagged as needing regeneration. Sadly, a workaround was also needed to prevent Python difflib from noting the difference anyways and producing an empty "false positive" diff. All templates and test files also needed to be altered to ensure that the first three lines of every test file will always be the autogeneration comment and date. Hopefully, this will now stop the CI failures without creating any subtle additional bugs. * Touch up to bowling template. Added back the error raising utility. * Touch up to two-bucket template to add back in error raising utility. [no important files changed]
54 lines
1.9 KiB
Python
54 lines
1.9 KiB
Python
# These tests are auto-generated with test data from:
|
|
# https://github.com/exercism/problem-specifications/tree/main/exercises/isogram/canonical-data.json
|
|
# File last updated on 2023-07-19
|
|
|
|
import unittest
|
|
|
|
from isogram import (
|
|
is_isogram,
|
|
)
|
|
|
|
|
|
class IsogramTest(unittest.TestCase):
|
|
def test_empty_string(self):
|
|
self.assertIs(is_isogram(""), True)
|
|
|
|
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)
|
|
|
|
def test_word_with_duplicated_character_and_with_two_hyphens(self):
|
|
self.assertIs(is_isogram("up-to-date"), False)
|