|
| 1 | +fn process_response_case(phrase: &str, expected_response: &str) { |
| 2 | + assert_eq!(bob::reply(phrase), expected_response); |
| 3 | +} |
| 4 | + |
| 5 | +#[test] |
| 6 | +/// stating something |
| 7 | +fn test_stating_something() { |
| 8 | + process_response_case("Tom-ay-to, tom-aaaah-to.", "Whatever."); |
| 9 | +} |
| 10 | + |
| 11 | +#[test] |
| 12 | +#[ignore] |
| 13 | +/// ending with whitespace |
| 14 | +fn test_ending_with_whitespace() { |
| 15 | + process_response_case("Okay if like my spacebar quite a bit? ", "Sure."); |
| 16 | +} |
| 17 | + |
| 18 | +#[test] |
| 19 | +#[ignore] |
| 20 | +/// shouting numbers |
| 21 | +fn test_shouting_numbers() { |
| 22 | + process_response_case("1, 2, 3 GO!", "Whoa, chill out!"); |
| 23 | +} |
| 24 | + |
| 25 | +#[test] |
| 26 | +#[ignore] |
| 27 | +/// other whitespace |
| 28 | +fn test_other_whitespace() { |
| 29 | + process_response_case("\r\r ", "Fine. Be that way!"); |
| 30 | +} |
| 31 | + |
| 32 | +#[test] |
| 33 | +#[ignore] |
| 34 | +/// shouting with special characters |
| 35 | +fn test_shouting_with_special_characters() { |
| 36 | + process_response_case( |
| 37 | + "ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!", |
| 38 | + "Whoa, chill out!", |
| 39 | + ); |
| 40 | +} |
| 41 | + |
| 42 | +#[test] |
| 43 | +#[ignore] |
| 44 | +/// talking forcefully |
| 45 | +fn test_talking_forcefully() { |
| 46 | + process_response_case("Hi there!", "Whatever."); |
| 47 | +} |
| 48 | + |
| 49 | +#[test] |
| 50 | +#[ignore] |
| 51 | +/// prattling on |
| 52 | +fn test_prattling_on() { |
| 53 | + process_response_case("Wait! Hang on. Are you going to be OK?", "Sure."); |
| 54 | +} |
| 55 | + |
| 56 | +#[test] |
| 57 | +#[ignore] |
| 58 | +/// forceful question |
| 59 | +fn test_forceful_question() { |
| 60 | + process_response_case("WHAT'S GOING ON?", "Calm down, I know what I'm doing!"); |
| 61 | +} |
| 62 | + |
| 63 | +#[test] |
| 64 | +#[ignore] |
| 65 | +/// shouting with no exclamation mark |
| 66 | +fn test_shouting_with_no_exclamation_mark() { |
| 67 | + process_response_case("I HATE THE DENTIST", "Whoa, chill out!"); |
| 68 | +} |
| 69 | + |
| 70 | +#[test] |
| 71 | +#[ignore] |
| 72 | +/// asking gibberish |
| 73 | +fn test_asking_gibberish() { |
| 74 | + process_response_case("fffbbcbeab?", "Sure."); |
| 75 | +} |
| 76 | + |
| 77 | +#[test] |
| 78 | +#[ignore] |
| 79 | +/// question with no letters |
| 80 | +fn test_question_with_no_letters() { |
| 81 | + process_response_case("4?", "Sure."); |
| 82 | +} |
| 83 | + |
| 84 | +#[test] |
| 85 | +#[ignore] |
| 86 | +/// no letters |
| 87 | +fn test_no_letters() { |
| 88 | + process_response_case("1, 2, 3", "Whatever."); |
| 89 | +} |
| 90 | + |
| 91 | +#[test] |
| 92 | +#[ignore] |
| 93 | +/// statement containing question mark |
| 94 | +fn test_statement_containing_question_mark() { |
| 95 | + process_response_case("Ending with ? means a question.", "Whatever."); |
| 96 | +} |
| 97 | + |
| 98 | +//NEW |
| 99 | +#[test] |
| 100 | +#[ignore] |
| 101 | +/// multiple line question |
| 102 | +fn test_multiple_line_question() { |
| 103 | + process_response_case( |
| 104 | + "\rDoes this cryogenic chamber make me look fat?\rNo.", |
| 105 | + "Whatever.", |
| 106 | + ); |
| 107 | +} |
| 108 | + |
| 109 | +#[test] |
| 110 | +#[ignore] |
| 111 | +/// non-question ending with whitespace |
| 112 | +fn test_nonquestion_ending_with_whitespace() { |
| 113 | + process_response_case( |
| 114 | + "This is a statement ending with whitespace ", |
| 115 | + "Whatever.", |
| 116 | + ); |
| 117 | +} |
| 118 | + |
| 119 | +#[test] |
| 120 | +#[ignore] |
| 121 | +/// shouting |
| 122 | +fn test_shouting() { |
| 123 | + process_response_case("WATCH OUT!", "Whoa, chill out!"); |
| 124 | +} |
| 125 | + |
| 126 | +#[test] |
| 127 | +#[ignore] |
| 128 | +/// non-letters with question |
| 129 | +fn test_nonletters_with_question() { |
| 130 | + process_response_case(":) ?", "Sure."); |
| 131 | +} |
| 132 | + |
| 133 | +#[test] |
| 134 | +#[ignore] |
| 135 | +/// shouting gibberish |
| 136 | +fn test_shouting_gibberish() { |
| 137 | + process_response_case("FCECDFCAAB", "Whoa, chill out!"); |
| 138 | +} |
| 139 | + |
| 140 | +#[test] |
| 141 | +#[ignore] |
| 142 | +/// asking a question |
| 143 | +fn test_asking_a_question() { |
| 144 | + process_response_case("Does this cryogenic chamber make me look fat?", "Sure."); |
| 145 | +} |
| 146 | + |
| 147 | +#[test] |
| 148 | +#[ignore] |
| 149 | +/// asking a numeric question |
| 150 | +fn test_asking_a_numeric_question() { |
| 151 | + process_response_case("You are, what, like 15?", "Sure."); |
| 152 | +} |
| 153 | + |
| 154 | +#[test] |
| 155 | +#[ignore] |
| 156 | +/// silence |
| 157 | +fn test_silence() { |
| 158 | + process_response_case("", "Fine. Be that way!"); |
| 159 | +} |
| 160 | + |
| 161 | +#[test] |
| 162 | +#[ignore] |
| 163 | +/// starting with whitespace |
| 164 | +fn test_starting_with_whitespace() { |
| 165 | + process_response_case(" hmmmmmmm...", "Whatever."); |
| 166 | +} |
| 167 | + |
| 168 | +#[test] |
| 169 | +#[ignore] |
| 170 | +/// using acronyms in regular speech |
| 171 | +fn test_using_acronyms_in_regular_speech() { |
| 172 | + process_response_case( |
| 173 | + "It's OK if you don't want to go work for NASA.", |
| 174 | + "Whatever.", |
| 175 | + ); |
| 176 | +} |
| 177 | + |
| 178 | +#[test] |
| 179 | +#[ignore] |
| 180 | +/// alternate silence |
| 181 | +fn test_alternate_silence() { |
| 182 | + process_response_case(" ", "Fine. Be that way!"); |
| 183 | +} |
| 184 | + |
| 185 | +#[test] |
| 186 | +#[ignore] |
| 187 | +/// prolonged silence |
| 188 | +fn test_prolonged_silence() { |
| 189 | + process_response_case(" ", "Fine. Be that way!"); |
| 190 | +} |
0 commit comments