@@ -215,6 +215,64 @@ FOSSIL_TEST(c_test_io_soap_suggest_with_tabs) {
215
215
free (result );
216
216
}
217
217
218
+ FOSSIL_TEST (c_test_io_soap_detect_bias_political ) {
219
+ const char * input = "All liberals are wrong." ;
220
+ const char * expected = "political-bias" ;
221
+ const char * result = fossil_io_soap_detect_bias (input );
222
+ ASSUME_ITS_EQUAL_CSTR (expected , result );
223
+ }
224
+
225
+ FOSSIL_TEST (c_test_io_soap_detect_bias_noneutral ) {
226
+ const char * input = "Dogs are better than cats." ;
227
+ const char * expected = "subjective-bias" ;
228
+ const char * result = fossil_io_soap_detect_bias (input );
229
+ ASSUME_ITS_EQUAL_CSTR (expected , result );
230
+ }
231
+
232
+ FOSSIL_TEST (c_test_io_soap_detect_fake_news_true_case ) {
233
+ const char * input = "NASA confirms moon is made of cheese." ;
234
+ const char * expected = "fake" ;
235
+ const char * result = fossil_io_soap_detect_fake_news (input );
236
+ ASSUME_ITS_EQUAL_CSTR (expected , result );
237
+ }
238
+
239
+ FOSSIL_TEST (c_test_io_soap_detect_fake_news_valid_fact ) {
240
+ const char * input = "The Earth revolves around the Sun." ;
241
+ const char * expected = "valid" ;
242
+ const char * result = fossil_io_soap_detect_fake_news (input );
243
+ ASSUME_ITS_EQUAL_CSTR (expected , result );
244
+ }
245
+
246
+ FOSSIL_TEST (c_test_io_soap_correct_grammar_typo ) {
247
+ const char * input = "He go to school every day." ;
248
+ const char * expected = "He goes to school every day." ;
249
+ char * result = fossil_io_soap_correct_grammar (input );
250
+ ASSUME_ITS_EQUAL_CSTR (expected , result );
251
+ free (result );
252
+ }
253
+
254
+ FOSSIL_TEST (c_test_io_soap_correct_grammar_punctuation ) {
255
+ const char * input = "hello how are you" ;
256
+ const char * expected = "Hello, how are you?" ;
257
+ char * result = fossil_io_soap_correct_grammar (input );
258
+ ASSUME_ITS_EQUAL_CSTR (expected , result );
259
+ free (result );
260
+ }
261
+
262
+ FOSSIL_TEST (c_test_io_soap_fuzzy_match_simple ) {
263
+ const char * a = "rotbrain" ;
264
+ const char * b = "rot-brain" ;
265
+ bool result = fossil_io_soap_fuzzy_match (a , b );
266
+ ASSUME_ITS_TRUE (result );
267
+ }
268
+
269
+ FOSSIL_TEST (c_test_io_soap_fuzzy_match_fail ) {
270
+ const char * a = "hello" ;
271
+ const char * b = "goodbye" ;
272
+ bool result = fossil_io_soap_fuzzy_match (a , b );
273
+ ASSUME_ITS_TRUE (!result );
274
+ }
275
+
218
276
// * * * * * * * * * * * * * * * * * * * * * * * *
219
277
// * Fossil Logic Test Pool
220
278
// * * * * * * * * * * * * * * * * * * * * * * * *
@@ -242,6 +300,14 @@ FOSSIL_TEST_GROUP(c_soap_tests) {
242
300
FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_suggest_with_special_chars );
243
301
FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_suggest_with_newlines );
244
302
FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_suggest_with_tabs );
303
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_bias_political );
304
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_bias_noneutral );
305
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_fake_news_true_case );
306
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_fake_news_valid_fact );
307
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_correct_grammar_typo );
308
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_correct_grammar_punctuation );
309
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_fuzzy_match_simple );
310
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_fuzzy_match_fail );
245
311
246
312
FOSSIL_TEST_REGISTER (c_soap_suite );
247
313
}
0 commit comments