|
| 1 | +module main |
| 2 | + |
| 3 | +fn test_verse__first_day_a_partridge_in_a_pear_tree() { |
| 4 | + expected := 'On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.' |
| 5 | + assert recite(1, 1) == expected |
| 6 | +} |
| 7 | + |
| 8 | +fn test_verse__second_day_two_turtle_doves() { |
| 9 | + expected := 'On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.' |
| 10 | + assert recite(2, 2) == expected |
| 11 | +} |
| 12 | + |
| 13 | +fn test_verse__third_day_three_french_hens() { |
| 14 | + expected := 'On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 15 | + assert recite(3, 3) == expected |
| 16 | +} |
| 17 | + |
| 18 | +fn test_verse__fourth_day_four_calling_birds() { |
| 19 | + expected := 'On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 20 | + assert recite(4, 4) == expected |
| 21 | +} |
| 22 | + |
| 23 | +fn test_verse__fifth_day_five_gold_rings() { |
| 24 | + expected := 'On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 25 | + assert recite(5, 5) == expected |
| 26 | +} |
| 27 | + |
| 28 | +fn test_verse__sixth_day_six_geese_a_laying() { |
| 29 | + expected := 'On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 30 | + assert recite(6, 6) == expected |
| 31 | +} |
| 32 | + |
| 33 | +fn test_verse__seventh_day_seven_swans_a_swimming() { |
| 34 | + expected := 'On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 35 | + assert recite(7, 7) == expected |
| 36 | +} |
| 37 | + |
| 38 | +fn test_verse__eighth_day_eight_maids_a_milking() { |
| 39 | + expected := 'On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 40 | + assert recite(8, 8) == expected |
| 41 | +} |
| 42 | + |
| 43 | +fn test_verse__ninth_day_nine_ladies_dancing() { |
| 44 | + expected := 'On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 45 | + assert recite(9, 9) == expected |
| 46 | +} |
| 47 | + |
| 48 | +fn test_verse__tenth_day_ten_lords_a_leaping() { |
| 49 | + expected := 'On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 50 | + assert recite(10, 10) == expected |
| 51 | +} |
| 52 | + |
| 53 | +fn test_verse__eleventh_day_eleven_pipers_piping() { |
| 54 | + expected := 'On the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 55 | + assert recite(11, 11) == expected |
| 56 | +} |
| 57 | + |
| 58 | +fn test_verse__twelfth_day_twelve_drummers_drumming() { |
| 59 | + expected := 'On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.' |
| 60 | + assert recite(12, 12) == expected |
| 61 | +} |
| 62 | + |
| 63 | +fn test_lyrics__recites_first_three_verses_of_the_song() { |
| 64 | + expected := ('On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree. |
| 65 | +On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree. |
| 66 | +On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.') |
| 67 | + assert recite(1, 3) == expected |
| 68 | +} |
| 69 | + |
| 70 | +fn test_lyrics__recites_three_verses_from_the_middle_of_the_song() { |
| 71 | + expected := ('On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 72 | +On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 73 | +On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.') |
| 74 | + assert recite(4, 6) == expected |
| 75 | +} |
| 76 | + |
| 77 | +fn test_lyrics__recites_the_whole_song() { |
| 78 | + expected := ('On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree. |
| 79 | +On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree. |
| 80 | +On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 81 | +On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 82 | +On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 83 | +On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 84 | +On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 85 | +On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 86 | +On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 87 | +On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 88 | +On the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. |
| 89 | +On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.') |
| 90 | + assert recite(1, 12) == expected |
| 91 | +} |
0 commit comments