@@ -63,6 +63,38 @@ FOSSIL_TEST_CASE(cpp_test_soap_count_offensive) {
6363 ASSUME_ITS_EQUAL_I32 (2 , fossil_soap_count_offensive (input));
6464}
6565
66+ FOSSIL_TEST_CASE (cpp_test_soap_sanitize_multiple) {
67+ char input[] = " curse1 and curse2 are both offensive." ;
68+ char expected[] = " *** and *** are both offensive." ;
69+
70+ fossil_soap_sanitize (input);
71+
72+ ASSUME_ITS_EQUAL_CSTR (expected, input);
73+ }
74+
75+ FOSSIL_TEST_CASE (cpp_test_soap_sanitize_no_offensive) {
76+ char input[] = " This is a clean sentence." ;
77+ char expected[] = " This is a clean sentence." ;
78+
79+ fossil_soap_sanitize (input);
80+
81+ ASSUME_ITS_EQUAL_CSTR (expected, input);
82+ }
83+
84+ FOSSIL_TEST_CASE (cpp_test_soap_is_offensive_empty) {
85+ ASSUME_ITS_FALSE (fossil_soap_is_offensive (" " ));
86+ }
87+
88+ FOSSIL_TEST_CASE (cpp_test_soap_count_offensive_none) {
89+ char input[] = " This is a clean sentence." ;
90+ ASSUME_ITS_EQUAL_I32 (0 , fossil_soap_count_offensive (input));
91+ }
92+
93+ FOSSIL_TEST_CASE (cpp_test_soap_count_offensive_multiple) {
94+ char input[] = " curse1, curse2, and curse1 are all offensive." ;
95+ ASSUME_ITS_EQUAL_I32 (3 , fossil_soap_count_offensive (input));
96+ }
97+
6698// * * * * * * * * * * * * * * * * * * * * * * * *
6799// * Fossil Logic Test Pool
68100// * * * * * * * * * * * * * * * * * * * * * * * *
@@ -71,6 +103,11 @@ FOSSIL_TEST_GROUP(cpp_soap_tests) {
71103 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_sanitize);
72104 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_is_offensive);
73105 FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_count_offensive);
106+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_sanitize_multiple);
107+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_sanitize_no_offensive);
108+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_is_offensive_empty);
109+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_count_offensive_none);
110+ FOSSIL_TEST_ADD (cpp_soap_suite, cpp_test_soap_count_offensive_multiple);
74111
75112 FOSSIL_TEST_REGISTER (cpp_soap_suite);
76113}
0 commit comments