Skip to content

update pig-latin tests to 1.1.0 closes #1019 #1073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions exercises/pig-latin/pig_latin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pig_latin import translate


# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0

class PigLatinTests(unittest.TestCase):
def test_word_beginning_with_a(self):
Expand All @@ -30,9 +30,6 @@ def test_word_beginning_with_p(self):
def test_word_beginning_with_k(self):
self.assertEqual(translate("koala"), "oalakay")

def test_word_beginning_with_y(self):
self.assertEqual(translate("yellow"), "ellowyay")

def test_word_beginning_with_x(self):
self.assertEqual(translate("xenon"), "enonxay")

Expand Down Expand Up @@ -63,6 +60,15 @@ def test_word_beginning_with_yt(self):
def test_word_beginning_with_xr(self):
self.assertEqual(translate("xray"), "xrayay")

def test_word_beginning_with_y(self):
self.assertEqual(translate("yellow"), "ellowyay")

def test_y_after_initial_consonant_cluster(self):
self.assertEqual(translate("rhythm"), "ythmrhay")

def test_y_as_second_letter_in_two_letter_word(self):
self.assertEqual(translate("my"), "ymay")

def test_a_whole_phrase(self):
self.assertEqual(translate("quick fast run"), "ickquay astfay unray")

Expand Down