|
| 1 | +use bottle_song::*; |
| 2 | + |
| 3 | +#[test] |
| 4 | +fn first_generic_verse() { |
| 5 | + assert_eq!( |
| 6 | + recite(10, 1).trim(), |
| 7 | + concat!( |
| 8 | + "Ten green bottles hanging on the wall,\n", |
| 9 | + "Ten green bottles hanging on the wall,\n", |
| 10 | + "And if one green bottle should accidentally fall,\n", |
| 11 | + "There'll be nine green bottles hanging on the wall.", |
| 12 | + ) |
| 13 | + ); |
| 14 | +} |
| 15 | + |
| 16 | +#[test] |
| 17 | +#[ignore] |
| 18 | +fn last_generic_verse() { |
| 19 | + assert_eq!( |
| 20 | + recite(3, 1).trim(), |
| 21 | + concat!( |
| 22 | + "Three green bottles hanging on the wall,\n", |
| 23 | + "Three green bottles hanging on the wall,\n", |
| 24 | + "And if one green bottle should accidentally fall,\n", |
| 25 | + "There'll be two green bottles hanging on the wall.", |
| 26 | + ) |
| 27 | + ); |
| 28 | +} |
| 29 | + |
| 30 | +#[test] |
| 31 | +#[ignore] |
| 32 | +fn verse_with_2_bottles() { |
| 33 | + assert_eq!( |
| 34 | + recite(2, 1).trim(), |
| 35 | + concat!( |
| 36 | + "Two green bottles hanging on the wall,\n", |
| 37 | + "Two green bottles hanging on the wall,\n", |
| 38 | + "And if one green bottle should accidentally fall,\n", |
| 39 | + "There'll be one green bottle hanging on the wall.", |
| 40 | + ) |
| 41 | + ); |
| 42 | +} |
| 43 | + |
| 44 | +#[test] |
| 45 | +#[ignore] |
| 46 | +fn verse_with_1_bottle() { |
| 47 | + assert_eq!( |
| 48 | + recite(1, 1).trim(), |
| 49 | + concat!( |
| 50 | + "One green bottle hanging on the wall,\n", |
| 51 | + "One green bottle hanging on the wall,\n", |
| 52 | + "And if one green bottle should accidentally fall,\n", |
| 53 | + "There'll be no green bottles hanging on the wall.", |
| 54 | + ) |
| 55 | + ); |
| 56 | +} |
| 57 | + |
| 58 | +#[test] |
| 59 | +#[ignore] |
| 60 | +fn first_two_verses() { |
| 61 | + assert_eq!( |
| 62 | + recite(10, 2).trim(), |
| 63 | + concat!( |
| 64 | + "Ten green bottles hanging on the wall,\n", |
| 65 | + "Ten green bottles hanging on the wall,\n", |
| 66 | + "And if one green bottle should accidentally fall,\n", |
| 67 | + "There'll be nine green bottles hanging on the wall.\n", |
| 68 | + "\n", |
| 69 | + "Nine green bottles hanging on the wall,\n", |
| 70 | + "Nine green bottles hanging on the wall,\n", |
| 71 | + "And if one green bottle should accidentally fall,\n", |
| 72 | + "There'll be eight green bottles hanging on the wall.", |
| 73 | + ) |
| 74 | + ); |
| 75 | +} |
| 76 | + |
| 77 | +#[test] |
| 78 | +#[ignore] |
| 79 | +fn last_three_verses() { |
| 80 | + assert_eq!( |
| 81 | + recite(3, 3).trim(), |
| 82 | + concat!( |
| 83 | + "Three green bottles hanging on the wall,\n", |
| 84 | + "Three green bottles hanging on the wall,\n", |
| 85 | + "And if one green bottle should accidentally fall,\n", |
| 86 | + "There'll be two green bottles hanging on the wall.\n", |
| 87 | + "\n", |
| 88 | + "Two green bottles hanging on the wall,\n", |
| 89 | + "Two green bottles hanging on the wall,\n", |
| 90 | + "And if one green bottle should accidentally fall,\n", |
| 91 | + "There'll be one green bottle hanging on the wall.\n", |
| 92 | + "\n", |
| 93 | + "One green bottle hanging on the wall,\n", |
| 94 | + "One green bottle hanging on the wall,\n", |
| 95 | + "And if one green bottle should accidentally fall,\n", |
| 96 | + "There'll be no green bottles hanging on the wall.", |
| 97 | + ) |
| 98 | + ); |
| 99 | +} |
| 100 | + |
| 101 | +#[test] |
| 102 | +#[ignore] |
| 103 | +fn all_verses() { |
| 104 | + assert_eq!( |
| 105 | + recite(10, 10).trim(), |
| 106 | + concat!( |
| 107 | + "Ten green bottles hanging on the wall,\n", |
| 108 | + "Ten green bottles hanging on the wall,\n", |
| 109 | + "And if one green bottle should accidentally fall,\n", |
| 110 | + "There'll be nine green bottles hanging on the wall.\n", |
| 111 | + "\n", |
| 112 | + "Nine green bottles hanging on the wall,\n", |
| 113 | + "Nine green bottles hanging on the wall,\n", |
| 114 | + "And if one green bottle should accidentally fall,\n", |
| 115 | + "There'll be eight green bottles hanging on the wall.\n", |
| 116 | + "\n", |
| 117 | + "Eight green bottles hanging on the wall,\n", |
| 118 | + "Eight green bottles hanging on the wall,\n", |
| 119 | + "And if one green bottle should accidentally fall,\n", |
| 120 | + "There'll be seven green bottles hanging on the wall.\n", |
| 121 | + "\n", |
| 122 | + "Seven green bottles hanging on the wall,\n", |
| 123 | + "Seven green bottles hanging on the wall,\n", |
| 124 | + "And if one green bottle should accidentally fall,\n", |
| 125 | + "There'll be six green bottles hanging on the wall.\n", |
| 126 | + "\n", |
| 127 | + "Six green bottles hanging on the wall,\n", |
| 128 | + "Six green bottles hanging on the wall,\n", |
| 129 | + "And if one green bottle should accidentally fall,\n", |
| 130 | + "There'll be five green bottles hanging on the wall.\n", |
| 131 | + "\n", |
| 132 | + "Five green bottles hanging on the wall,\n", |
| 133 | + "Five green bottles hanging on the wall,\n", |
| 134 | + "And if one green bottle should accidentally fall,\n", |
| 135 | + "There'll be four green bottles hanging on the wall.\n", |
| 136 | + "\n", |
| 137 | + "Four green bottles hanging on the wall,\n", |
| 138 | + "Four green bottles hanging on the wall,\n", |
| 139 | + "And if one green bottle should accidentally fall,\n", |
| 140 | + "There'll be three green bottles hanging on the wall.\n", |
| 141 | + "\n", |
| 142 | + "Three green bottles hanging on the wall,\n", |
| 143 | + "Three green bottles hanging on the wall,\n", |
| 144 | + "And if one green bottle should accidentally fall,\n", |
| 145 | + "There'll be two green bottles hanging on the wall.\n", |
| 146 | + "\n", |
| 147 | + "Two green bottles hanging on the wall,\n", |
| 148 | + "Two green bottles hanging on the wall,\n", |
| 149 | + "And if one green bottle should accidentally fall,\n", |
| 150 | + "There'll be one green bottle hanging on the wall.\n", |
| 151 | + "\n", |
| 152 | + "One green bottle hanging on the wall,\n", |
| 153 | + "One green bottle hanging on the wall,\n", |
| 154 | + "And if one green bottle should accidentally fall,\n", |
| 155 | + "There'll be no green bottles hanging on the wall.", |
| 156 | + ) |
| 157 | + ); |
| 158 | +} |
0 commit comments