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