@@ -130,6 +130,100 @@ FOSSIL_TEST_CASE(cpp_test_soap_count_rotbrain_with_punctuation) {
130130 ASSUME_ITS_EQUAL_I32 (2 , fossil_soap_count_rotbrain (input));
131131}
132132
133+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_offensive) {
134+ char input[] = " This is a test with curse1 and racist_phrase1." ;
135+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
136+ }
137+
138+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_rotbrain) {
139+ char input[] = " This is a test with lol and brb." ;
140+ ASSUME_ITS_EQUAL_I32 (2 , fossil_soap_context_aware (input));
141+ }
142+
143+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_clean) {
144+ char input[] = " This is a clean sentence." ;
145+ ASSUME_ITS_EQUAL_I32 (0 , fossil_soap_context_aware (input));
146+ }
147+
148+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_mixed) {
149+ char input[] = " This is a test with curse1 and lol." ;
150+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
151+ }
152+
153+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_case_insensitive) {
154+ char input[] = " This is a test with CuRsE1 and LoL." ;
155+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
156+ }
157+
158+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_punctuation) {
159+ char input[] = " This is a test with curse1, and lol!" ;
160+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
161+ }
162+
163+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_no_offensive_or_rotbrain) {
164+ char input[] = " This is a test with no offensive or rotbrain words." ;
165+ ASSUME_ITS_EQUAL_I32 (0 , fossil_soap_context_aware (input));
166+ }
167+
168+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_only_rotbrain) {
169+ char input[] = " This is a test with lol and brb." ;
170+ ASSUME_ITS_EQUAL_I32 (2 , fossil_soap_context_aware (input));
171+ }
172+
173+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_only_offensive) {
174+ char input[] = " This is a test with curse1 and racist_phrase1." ;
175+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
176+ }
177+
178+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_mixed_case) {
179+ char input[] = " This is a test with CuRsE1 and LoL." ;
180+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
181+ }
182+
183+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_special_characters) {
184+ char input[] = " This is a test with curse1@ and lol#." ;
185+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
186+ }
187+
188+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_numbers) {
189+ char input[] = " This is a test with curse1 and lol123." ;
190+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
191+ }
192+
193+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_mixed_content) {
194+ char input[] = " This is a test with curse1, lol, and clean words." ;
195+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
196+ }
197+
198+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_spaces) {
199+ char input[] = " This is a test with curse1 and lol ." ;
200+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
201+ }
202+
203+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_tabs) {
204+ char input[] = " This is a test with\t curse1\t and\t lol\t ." ;
205+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
206+ }
207+
208+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_newlines) {
209+ char input[] = " This is a test with\n curse1\n and\n lol\n ." ;
210+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
211+ }
212+
213+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_mixed_whitespace) {
214+ char input[] = " This is a test with \t\n curse1 \t\n and \t\n lol \t\n ." ;
215+ ASSUME_ITS_EQUAL_I32 (1 , fossil_soap_context_aware (input));
216+ }
217+
218+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_empty_string) {
219+ char input[] = " " ;
220+ ASSUME_ITS_EQUAL_I32 (0 , fossil_soap_context_aware (input));
221+ }
222+
223+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_null_string) {
224+ ASSUME_ITS_EQUAL_I32 (0 , fossil_soap_context_aware (NULL ));
225+ }
226+
133227FOSSIL_TEST_CASE (cpp_test_soap_sanitize_empty_string) {
134228 char input[] = " " ;
135229 char expected[] = " " ;
@@ -194,6 +288,45 @@ FOSSIL_TEST_CASE(cpp_test_soap_sanitize_with_punctuation) {
194288 ASSUME_ITS_EQUAL_CSTR (expected, input);
195289}
196290
291+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_numbers_and_special_characters) {
292+ char input[] = " This is a test with curse1@123 and lol#456." ;
293+ ASSUME_ITS_EQUAL_I32 (1 , fossil::io::Soap::context_aware (input));
294+ }
295+
296+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_mixed_case_and_punctuation) {
297+ char input[] = " This is a test with CuRsE1! and LoL?." ;
298+ ASSUME_ITS_EQUAL_I32 (1 , fossil::io::Soap::context_aware (input));
299+ }
300+
301+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_multiple_offensive_and_rotbrain) {
302+ char input[] = " This is a test with curse1, curse2, lol, and brb." ;
303+ ASSUME_ITS_EQUAL_I32 (2 , fossil::io::Soap::context_aware (input));
304+ }
305+
306+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_only_special_characters) {
307+ char input[] = " !@#$%^&*()" ;
308+ ASSUME_ITS_EQUAL_I32 (0 , fossil::io::Soap::context_aware (input));
309+ }
310+
311+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_only_numbers) {
312+ char input[] = " 1234567890" ;
313+ ASSUME_ITS_EQUAL_I32 (0 , fossil::io::Soap::context_aware (input));
314+ }
315+
316+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_mixed_numbers_and_words) {
317+ char input[] = " This is a test with 123curse1 and 456lol." ;
318+ ASSUME_ITS_EQUAL_I32 (1 , fossil::io::Soap::context_aware (input));
319+ }
320+
321+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_unicode_characters) {
322+ char input[] = " This is a test with curse1 and lol 😊." ;
323+ ASSUME_ITS_EQUAL_I32 (1 , fossil::io::Soap::context_aware (input));
324+ }
325+
326+ FOSSIL_TEST_CASE (cpp_test_soap_context_aware_with_long_text) {
327+ char input[] = " This is a very long test with multiple curse1, curse2, lol, and brb words to check the performance and accuracy of the context aware method." ;
328+ ASSUME_ITS_EQUAL_I32 (2 , fossil::io::Soap::context_aware (input));
329+ }
197330
198331// * * * * * * * * * * * * * * * * * * * * * * * *
199332// * Fossil Logic Test Pool
@@ -212,6 +345,25 @@ FOSSIL_TEST_GROUP(cpp_soap_tests) {
212345 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_is_rotbrain_case_insensitive);
213346 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_count_rotbrain_mixed_case);
214347 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_sanitize_synonyms);
348+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_offensive);
349+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_rotbrain);
350+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_clean);
351+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_mixed);
352+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_case_insensitive);
353+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_punctuation);
354+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_no_offensive_or_rotbrain);
355+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_only_rotbrain);
356+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_only_offensive);
357+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_mixed_case);
358+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_special_characters);
359+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_numbers);
360+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_mixed_content);
361+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_spaces);
362+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_tabs);
363+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_newlines);
364+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_mixed_whitespace);
365+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_empty_string);
366+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_null_string);
215367
216368 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_sanitize_empty_string);
217369 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_sanitize_only_offensive);
@@ -223,6 +375,14 @@ FOSSIL_TEST_GROUP(cpp_soap_tests) {
223375 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_count_offensive_mixed_content);
224376 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_count_rotbrain_mixed_content);
225377 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_sanitize_with_punctuation);
378+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_numbers_and_special_characters);
379+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_mixed_case_and_punctuation);
380+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_multiple_offensive_and_rotbrain);
381+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_only_special_characters);
382+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_only_numbers);
383+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_mixed_numbers_and_words);
384+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_unicode_characters);
385+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_context_aware_with_long_text);
226386
227387 FOSSIL_TEST_REGISTER (cpp_soap_suite);
228388}
0 commit comments