Skip to content

Commit 61adcc4

Browse files
update cases
1 parent 9f76f9e commit 61adcc4

File tree

1 file changed

+36
-231
lines changed

1 file changed

+36
-231
lines changed

code/tests/cases/test_soap.cpp

Lines changed: 36 additions & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -43,178 +43,6 @@ FOSSIL_TEARDOWN(cpp_soap_suite) {
4343
// as samples for library usage.
4444
// * * * * * * * * * * * * * * * * * * * * * * * *
4545

46-
FOSSIL_TEST(cpp_test_io_soap_sanitize) {
47-
const char *input = "This is a rot-brain sentence.";
48-
const char *expected = "This is a stupid sentence.";
49-
char *result = fossil_io_soap_sanitize(input);
50-
ASSUME_ITS_EQUAL_CSTR(expected, result);
51-
free(result);
52-
}
53-
54-
FOSSIL_TEST(cpp_test_io_soap_sanitize_no_offensive) {
55-
const char *input = "This is a clean sentence.";
56-
const char *expected = "This is a clean sentence.";
57-
char *result = fossil_io_soap_sanitize(input);
58-
ASSUME_ITS_EQUAL_CSTR(expected, result);
59-
free(result);
60-
}
61-
62-
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_punctuation) {
63-
const char *input = "This is a test with punctuation, and special characters!";
64-
const char *expected = "This is a test with punctuation, and special characters!";
65-
char *result = fossil_io_soap_sanitize(input);
66-
ASSUME_ITS_EQUAL_CSTR(expected, result);
67-
free(result);
68-
}
69-
70-
FOSSIL_TEST(cpp_test_io_soap_sanitize_empty_input) {
71-
const char *input = "";
72-
const char *expected = "";
73-
char *result = fossil_io_soap_sanitize(input);
74-
ASSUME_ITS_EQUAL_CSTR(expected, result);
75-
free(result);
76-
}
77-
78-
FOSSIL_TEST(cpp_test_io_soap_sanitize_only_whitespace) {
79-
const char *input = " ";
80-
const char *expected = " ";
81-
char *result = fossil_io_soap_sanitize(input);
82-
ASSUME_ITS_EQUAL_CSTR(expected, result);
83-
free(result);
84-
}
85-
86-
FOSSIL_TEST(cpp_test_io_soap_sanitize_long_input) {
87-
const char *input = "This is a very long input string that exceeds the buffer size";
88-
const char *expected = "This is a very long input string that exceeds the buffer size";
89-
char *result = fossil_io_soap_sanitize(input);
90-
ASSUME_ITS_EQUAL_CSTR(expected, result);
91-
free(result);
92-
}
93-
94-
FOSSIL_TEST(cpp_test_io_soap_suggest) {
95-
const char *input = "This is a rot-brain sentence.";
96-
const char *expected = "This is a stupid sentence.";
97-
char *result = fossil_io_soap_suggest(input);
98-
ASSUME_ITS_EQUAL_CSTR(expected, result);
99-
free(result);
100-
}
101-
102-
FOSSIL_TEST(cpp_test_io_soap_suggest_no_offensive) {
103-
const char *input = "This is a clean sentence.";
104-
const char *expected = "This is a clean sentence.";
105-
char *result = fossil_io_soap_suggest(input);
106-
ASSUME_ITS_EQUAL_CSTR(expected, result);
107-
free(result);
108-
}
109-
110-
FOSSIL_TEST(cpp_test_io_soap_add_custom_filter) {
111-
const char *phrase = "custom";
112-
int result = fossil_io_soap_add_custom_filter(phrase);
113-
ASSUME_ITS_EQUAL_I32(0, result);
114-
}
115-
116-
FOSSIL_TEST(cpp_test_io_soap_detect_tone_sarcastic) {
117-
const char *input = "Oh, great. Another meeting.";
118-
const char *expected = "sarcastic";
119-
const char *result = fossil_io_soap_detect_tone(input);
120-
ASSUME_ITS_EQUAL_CSTR(expected, result);
121-
}
122-
123-
FOSSIL_TEST(cpp_test_io_soap_detect_tone_formal) {
124-
const char *input = "Dear Sir or Madam,";
125-
const char *expected = "formal";
126-
const char *result = fossil_io_soap_detect_tone(input);
127-
ASSUME_ITS_EQUAL_CSTR(expected, result);
128-
}
129-
130-
FOSSIL_TEST(cpp_test_io_soap_detect_tone_casual) {
131-
const char *input = "Hey, what's up?";
132-
const char *expected = "casual";
133-
const char *result = fossil_io_soap_detect_tone(input);
134-
ASSUME_ITS_EQUAL_CSTR(expected, result);
135-
}
136-
137-
FOSSIL_TEST(cpp_test_io_soap_sanitize_leetspeak) {
138-
const char *input = "Th1s 1s 4 l33tspeak s3nt3nc3.";
139-
const char *expected = "This is a leetspeak sentence.";
140-
char *result = fossil_io_soap_sanitize(input);
141-
ASSUME_ITS_EQUAL_CSTR(expected, result);
142-
free(result);
143-
}
144-
145-
FOSSIL_TEST(cpp_test_io_soap_sanitize_mixed_case) {
146-
const char *input = "This Is A Rot-Brain Sentence.";
147-
const char *expected = "This Is A stupid Sentence.";
148-
char *result = fossil_io_soap_sanitize(input);
149-
ASSUME_ITS_EQUAL_CSTR(expected, result);
150-
free(result);
151-
}
152-
153-
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_special_chars) {
154-
const char *input = "This is a test with special chars #$%^&*!";
155-
const char *expected = "This is a test with special chars #$%^&*!";
156-
char *result = fossil_io_soap_sanitize(input);
157-
ASSUME_ITS_EQUAL_CSTR(expected, result);
158-
free(result);
159-
}
160-
161-
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_newlines) {
162-
const char *input = "This is a test\nwith newlines.";
163-
const char *expected = "This is a test\nwith newlines.";
164-
char *result = fossil_io_soap_sanitize(input);
165-
ASSUME_ITS_EQUAL_CSTR(expected, result);
166-
free(result);
167-
}
168-
169-
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_tabs) {
170-
const char *input = "This is a test\twith tabs.";
171-
const char *expected = "This is a test\twith tabs.";
172-
char *result = fossil_io_soap_sanitize(input);
173-
ASSUME_ITS_EQUAL_CSTR(expected, result);
174-
free(result);
175-
}
176-
177-
FOSSIL_TEST(cpp_test_io_soap_suggest_leetspeak) {
178-
const char *input = "Th1s 1s 4 l33tspeak s3nt3nc3.";
179-
const char *expected = "This is a leetspeak sentence.";
180-
char *result = fossil_io_soap_suggest(input);
181-
ASSUME_ITS_EQUAL_CSTR(expected, result);
182-
free(result);
183-
}
184-
185-
FOSSIL_TEST(cpp_test_io_soap_suggest_mixed_case) {
186-
const char *input = "This Is A Rot-Brain Sentence.";
187-
const char *expected = "This Is A stupid Sentence.";
188-
char *result = fossil_io_soap_suggest(input);
189-
190-
ASSUME_ITS_EQUAL_CSTR(expected, result);
191-
free(result);
192-
}
193-
194-
FOSSIL_TEST(cpp_test_io_soap_suggest_with_special_chars) {
195-
const char *input = "This is a test with special chars #$%^&*!";
196-
const char *expected = "This is a test with special chars #$%^&*!";
197-
char *result = fossil_io_soap_suggest(input);
198-
ASSUME_ITS_EQUAL_CSTR(expected, result);
199-
free(result);
200-
}
201-
202-
FOSSIL_TEST(cpp_test_io_soap_suggest_with_newlines) {
203-
const char *input = "This is a test\nwith newlines.";
204-
const char *expected = "This is a test\nwith newlines.";
205-
char *result = fossil_io_soap_suggest(input);
206-
ASSUME_ITS_EQUAL_CSTR(expected, result);
207-
free(result);
208-
}
209-
210-
FOSSIL_TEST(cpp_test_io_soap_suggest_with_tabs) {
211-
const char *input = "This is a test\twith tabs.";
212-
const char *expected = "This is a test\twith tabs.";
213-
char *result = fossil_io_soap_suggest(input);
214-
ASSUME_ITS_EQUAL_CSTR(expected, result);
215-
free(result);
216-
}
217-
21846
FOSSIL_TEST(cpp_test_io_soap_sanitize_stl) {
21947
std::string input = "This is a rot-brain sentence.";
22048
std::string expected = "This is a stupid sentence.";
@@ -230,8 +58,8 @@ FOSSIL_TEST(cpp_test_io_soap_sanitize_no_offensive_stl) {
23058
}
23159

23260
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_punctuation_stl) {
233-
std::string input = "This is a test with punctuation, and special characters!";
234-
std::string expected = "This is a test with punctuation, and special characters!";
61+
std::string input = "This is gonna be funny, lol!";
62+
std::string expected = "This is going to be laugh out loud, laugh out loud!";
23563
std::string result = fossil::io::Soap::sanitize(input);
23664
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
23765
}
@@ -251,15 +79,15 @@ FOSSIL_TEST(cpp_test_io_soap_sanitize_only_whitespace_stl) {
25179
}
25280

25381
FOSSIL_TEST(cpp_test_io_soap_sanitize_long_input_stl) {
254-
std::string input = "This is a very long input string that exceeds the buffer size";
255-
std::string expected = "This is a very long input string that exceeds the buffer size";
82+
std::string input = "u gonna flex your vibe with that lit drip, fam?";
83+
std::string expected = "you going to show off your atmosphere with that exciting fashion, family?";
25684
std::string result = fossil::io::Soap::sanitize(input);
25785
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
25886
}
25987

26088
FOSSIL_TEST(cpp_test_io_soap_suggest_stl) {
261-
std::string input = "This is a rot-brain sentence.";
262-
std::string expected = "This is a stupid sentence.";
89+
std::string input = "idk why ppl are so salty, bruh.";
90+
std::string expected = "I don't know why people are so bitter, brother.";
26391
std::string result = fossil::io::Soap::suggest(input);
26492
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
26593
}
@@ -313,22 +141,22 @@ FOSSIL_TEST(cpp_test_io_soap_sanitize_mixed_case_stl) {
313141
}
314142

315143
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_special_chars_stl) {
316-
std::string input = "This is a test with special chars #$%^&*!";
317-
std::string expected = "This is a test with special chars #$%^&*!";
144+
std::string input = "skibidi #$%^&*! yeet";
145+
std::string expected = "dance #$%^&*! throw";
318146
std::string result = fossil::io::Soap::sanitize(input);
319147
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
320148
}
321149

322150
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_newlines_stl) {
323-
std::string input = "This is a test\nwith newlines.";
324-
std::string expected = "This is a test\nwith newlines.";
151+
std::string input = "no cap\nbet fam";
152+
std::string expected = "honestly\nokay family";
325153
std::string result = fossil::io::Soap::sanitize(input);
326154
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
327155
}
328156

329157
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_tabs_stl) {
330-
std::string input = "This is a test\twith tabs.";
331-
std::string expected = "This is a test\twith tabs.";
158+
std::string input = "ghost\tgoat\tgucci";
159+
std::string expected = "ignore\tlegend\tgood";
332160
std::string result = fossil::io::Soap::sanitize(input);
333161
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
334162
}
@@ -348,22 +176,22 @@ FOSSIL_TEST(cpp_test_io_soap_suggest_mixed_case_stl) {
348176
}
349177

350178
FOSSIL_TEST(cpp_test_io_soap_suggest_with_special_chars_stl) {
351-
std::string input = "This is a test with special chars #$%^&*!";
352-
std::string expected = "This is a test with special chars #$%^&*!";
179+
std::string input = "shade #$%^&*! slay";
180+
std::string expected = "insult #$%^&*! impress";
353181
std::string result = fossil::io::Soap::suggest(input);
354182
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
355183
}
356184

357185
FOSSIL_TEST(cpp_test_io_soap_suggest_with_newlines_stl) {
358-
std::string input = "This is a test\nwith newlines.";
359-
std::string expected = "This is a test\nwith newlines.";
186+
std::string input = "snatched\nstan\ntea";
187+
std::string expected = "stylish\nsuperfan\ngossip";
360188
std::string result = fossil::io::Soap::suggest(input);
361189
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
362190
}
363191

364192
FOSSIL_TEST(cpp_test_io_soap_suggest_with_tabs_stl) {
365-
std::string input = "This is a test\twith tabs.";
366-
std::string expected = "This is a test\twith tabs.";
193+
std::string input = "thirsty\twoke\tyolo";
194+
std::string expected = "desperate\taware\tyou only live once";
367195
std::string result = fossil::io::Soap::suggest(input);
368196
ASSUME_ITS_EQUAL_CSTR(expected.c_str(), result.c_str());
369197
}
@@ -385,8 +213,8 @@ FOSSIL_TEST(cpp_test_io_soap_sanitize_no_offensive_cstr) {
385213
}
386214

387215
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_punctuation_cstr) {
388-
const char *input = "This is a test with punctuation, and special characters!";
389-
const char *expected = "This is a test with punctuation, and special characters!";
216+
const char *input = "This is gonna be funny, lol!";
217+
const char *expected = "This is going to be laugh out loud, laugh out loud!";
390218
char *result = fossil::io::Soap::sanitize(input);
391219
ASSUME_ITS_EQUAL_CSTR(expected, result);
392220
free(result);
@@ -409,16 +237,16 @@ FOSSIL_TEST(cpp_test_io_soap_sanitize_only_whitespace_cstr) {
409237
}
410238

411239
FOSSIL_TEST(cpp_test_io_soap_sanitize_long_input_cstr) {
412-
const char *input = "This is a very long input string that exceeds the buffer size";
413-
const char *expected = "This is a very long input string that exceeds the buffer size";
240+
const char *input = "u gonna flex your vibe with that lit drip, fam?";
241+
const char *expected = "you going to show off your atmosphere with that exciting fashion, family?";
414242
char *result = fossil::io::Soap::sanitize(input);
415243
ASSUME_ITS_EQUAL_CSTR(expected, result);
416244
free(result);
417245
}
418246

419247
FOSSIL_TEST(cpp_test_io_soap_suggest_cstr) {
420-
const char *input = "This is a rot-brain sentence.";
421-
const char *expected = "This is a stupid sentence.";
248+
const char *input = "idk why ppl are so salty, bruh.";
249+
const char *expected = "I don't know why people are so bitter, brother.";
422250
char *result = fossil::io::Soap::suggest(input);
423251
ASSUME_ITS_EQUAL_CSTR(expected, result);
424252
free(result);
@@ -476,24 +304,24 @@ FOSSIL_TEST(cpp_test_io_soap_sanitize_mixed_case_cstr) {
476304
}
477305

478306
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_special_chars_cstr) {
479-
const char *input = "This is a test with special chars #$%^&*!";
480-
const char *expected = "This is a test with special chars #$%^&*!";
307+
const char *input = "skibidi #$%^&*! yeet";
308+
const char *expected = "dance #$%^&*! throw";
481309
char *result = fossil::io::Soap::sanitize(input);
482310
ASSUME_ITS_EQUAL_CSTR(expected, result);
483311
free(result);
484312
}
485313

486314
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_newlines_cstr) {
487-
const char *input = "This is a test\nwith newlines.";
488-
const char *expected = "This is a test\nwith newlines.";
315+
const char *input = "no cap\nbet fam";
316+
const char *expected = "honestly\nokay family";
489317
char *result = fossil::io::Soap::sanitize(input);
490318
ASSUME_ITS_EQUAL_CSTR(expected, result);
491319
free(result);
492320
}
493321

494322
FOSSIL_TEST(cpp_test_io_soap_sanitize_with_tabs_cstr) {
495-
const char *input = "This is a test\twith tabs.";
496-
const char *expected = "This is a test\twith tabs.";
323+
const char *input = "ghost\tgoat\tgucci";
324+
const char *expected = "ignore\tlegend\tgood";
497325
char *result = fossil::io::Soap::sanitize(input);
498326
ASSUME_ITS_EQUAL_CSTR(expected, result);
499327
free(result);
@@ -516,24 +344,24 @@ FOSSIL_TEST(cpp_test_io_soap_suggest_mixed_case_cstr) {
516344
}
517345

518346
FOSSIL_TEST(cpp_test_io_soap_suggest_with_special_chars_cstr) {
519-
const char *input = "This is a test with special chars #$%^&*!";
520-
const char *expected = "This is a test with special chars #$%^&*!";
347+
const char *input = "shade #$%^&*! slay";
348+
const char *expected = "insult #$%^&*! impress";
521349
char *result = fossil::io::Soap::suggest(input);
522350
ASSUME_ITS_EQUAL_CSTR(expected, result);
523351
free(result);
524352
}
525353

526354
FOSSIL_TEST(cpp_test_io_soap_suggest_with_newlines_cstr) {
527-
const char *input = "This is a test\nwith newlines.";
528-
const char *expected = "This is a test\nwith newlines.";
355+
const char *input = "snatched\nstan\ntea";
356+
const char *expected = "stylish\nsuperfan\ngossip";
529357
char *result = fossil::io::Soap::suggest(input);
530358
ASSUME_ITS_EQUAL_CSTR(expected, result);
531359
free(result);
532360
}
533361

534362
FOSSIL_TEST(cpp_test_io_soap_suggest_with_tabs_cstr) {
535-
const char *input = "This is a test\twith tabs.";
536-
const char *expected = "This is a test\twith tabs.";
363+
const char *input = "thirsty\twoke\tyolo";
364+
const char *expected = "desperate\taware\tyou only live once";
537365
char *result = fossil::io::Soap::suggest(input);
538366
ASSUME_ITS_EQUAL_CSTR(expected, result);
539367
free(result);
@@ -544,29 +372,6 @@ FOSSIL_TEST(cpp_test_io_soap_suggest_with_tabs_cstr) {
544372
// * * * * * * * * * * * * * * * * * * * * * * * *
545373

546374
FOSSIL_TEST_GROUP(cpp_soap_tests) {
547-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize);
548-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_no_offensive);
549-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_with_punctuation);
550-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_empty_input);
551-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_only_whitespace);
552-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_long_input);
553-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_suggest);
554-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_suggest_no_offensive);
555-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_add_custom_filter);
556-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_detect_tone_sarcastic);
557-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_detect_tone_formal);
558-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_detect_tone_casual);
559-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_leetspeak);
560-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_mixed_case);
561-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_with_special_chars);
562-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_with_newlines);
563-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_with_tabs);
564-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_suggest_leetspeak);
565-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_suggest_mixed_case);
566-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_suggest_with_special_chars);
567-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_suggest_with_newlines);
568-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_suggest_with_tabs);
569-
570375
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_stl);
571376
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_no_offensive_stl);
572377
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_io_soap_sanitize_with_punctuation_stl);

0 commit comments

Comments
 (0)