@@ -268,4 +268,64 @@ namespace {
268
268
} }),
269
269
" hash" );
270
270
}
271
+
272
+ TEST_F (Regression_Test, Export_Empty) {
273
+ fs::path source = getTestFilePath (" issue-276.c" );
274
+ auto [testGen, status] = createTestForFunction (source, 2 );
275
+
276
+ ASSERT_TRUE (status.ok ()) << status.error_message ();
277
+
278
+ checkTestCasePredicates (
279
+ testGen.tests .at (source).methods .begin ().value ().testCases ,
280
+ std::vector<TestCasePredicate>(
281
+ { [](const tests::Tests::MethodTestCase &testCase) {
282
+ return testCase.returnValue .view ->getEntryValue (nullptr ) == " 0" ;
283
+ } }),
284
+ " f1" );
285
+ }
286
+
287
+ TEST_F (Regression_Test, Export_Empty_String) {
288
+ fs::path source = getTestFilePath (" issue-276.c" );
289
+ auto [testGen, status] = createTestForFunction (source, 6 );
290
+
291
+ ASSERT_TRUE (status.ok ()) << status.error_message ();
292
+
293
+ checkTestCasePredicates (
294
+ testGen.tests .at (source).methods .begin ().value ().testCases ,
295
+ std::vector<TestCasePredicate>(
296
+ { [](const tests::Tests::MethodTestCase &testCase) {
297
+ return testCase.returnValue .view ->getEntryValue (nullptr ) == " '\\ 0'" ;
298
+ } }),
299
+ " f2" );
300
+ }
301
+
302
+ TEST_F (Regression_Test, Export_Int) {
303
+ fs::path source = getTestFilePath (" issue-276.c" );
304
+ auto [testGen, status] = createTestForFunction (source, 10 );
305
+
306
+ ASSERT_TRUE (status.ok ()) << status.error_message ();
307
+
308
+ checkTestCasePredicates (
309
+ testGen.tests .at (source).methods .begin ().value ().testCases ,
310
+ std::vector<TestCasePredicate>(
311
+ { [](const tests::Tests::MethodTestCase &testCase) {
312
+ return testCase.returnValue .view ->getEntryValue (nullptr ) == " 4" ;
313
+ } }),
314
+ " f3" );
315
+ }
316
+
317
+ TEST_F (Regression_Test, Export_String_Int) {
318
+ fs::path source = getTestFilePath (" issue-276.c" );
319
+ auto [testGen, status] = createTestForFunction (source, 14 );
320
+
321
+ ASSERT_TRUE (status.ok ()) << status.error_message ();
322
+
323
+ checkTestCasePredicates (
324
+ testGen.tests .at (source).methods .begin ().value ().testCases ,
325
+ std::vector<TestCasePredicate>(
326
+ { [](const tests::Tests::MethodTestCase &testCase) {
327
+ return testCase.returnValue .view ->getEntryValue (nullptr ) == " '4'" ;
328
+ } }),
329
+ " f4" );
330
+ }
271
331
}
0 commit comments