3
3
from pig_latin import translate
4
4
5
5
6
- # test cases adapted from `x-common //canonical-data.json` @ version: 1.0 .0
6
+ # Tests adapted from `problem-specifications //canonical-data.json` @ v1.1 .0
7
7
8
8
class PigLatinTests (unittest .TestCase ):
9
9
def test_word_beginning_with_a (self ):
@@ -30,9 +30,6 @@ def test_word_beginning_with_p(self):
30
30
def test_word_beginning_with_k (self ):
31
31
self .assertEqual (translate ("koala" ), "oalakay" )
32
32
33
- def test_word_beginning_with_y (self ):
34
- self .assertEqual (translate ("yellow" ), "ellowyay" )
35
-
36
33
def test_word_beginning_with_x (self ):
37
34
self .assertEqual (translate ("xenon" ), "enonxay" )
38
35
@@ -63,6 +60,15 @@ def test_word_beginning_with_yt(self):
63
60
def test_word_beginning_with_xr (self ):
64
61
self .assertEqual (translate ("xray" ), "xrayay" )
65
62
63
+ def test_y_is_treated_like_a_consonant_at_the_beginning_of_a_word (self ):
64
+ self .assertEqual (translate ("yellow" ), "ellowyay" )
65
+
66
+ def test_y_is_treated_like_a_vowel_at_the_end_of_a_consonant_cluster (self ):
67
+ self .assertEqual (translate ("rhythm" ), "ythmrhay" )
68
+
69
+ def test_y_as_second_letter_in_two_letter_word (self ):
70
+ self .assertEqual (translate ("my" ), "ymay" )
71
+
66
72
def test_a_whole_phrase (self ):
67
73
self .assertEqual (translate ("quick fast run" ), "ickquay astfay unray" )
68
74
0 commit comments