2 libmc - checks search functions
5 Free Software Foundation, Inc.
8 Steef Boerrigter <sxmboer@gmail.com>, 2022
10 This file is part of the Midnight Commander.
12 The Midnight Commander is free software: you can redistribute it
13 and/or modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation, either version 3 of the License,
15 or (at your option) any later version.
17 The Midnight Commander is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #define TEST_SUITE_NAME "lib/search/search"
28 #include "tests/mctest.h"
30 #include "search.c" /* for testing static functions */
32 /* --------------------------------------------------------------------------------------------- */
34 /* @DataSource("test_regex_multiline_str_ds") */
36 static const struct test_regex_multiline_str_ds
38 const mc_search_type_t type
;
40 const char *search_str
;
41 const gboolean retval
;
42 } test_regex_multiline_str_ds
[] =
80 { /* 7. mc-4.8.28 fails this edge condition */
86 { /* 8. mc-4.8.28 fails this edge condition */
92 { /* 9. regex including newline */
98 { /* 10. regex's newline support */
107 /* @Test(dataSource = "test_regex_multiline_str_ds") */
109 START_PARAMETRIZED_TEST (test_regex_multiline_str
, test_regex_multiline_str_ds
)
116 s
= mc_search_new (data
->buffer
, NULL
);
117 s
->is_case_sensitive
= FALSE
;
118 s
->search_type
= data
->type
;
121 retval
= mc_search (data
->search_str
, DEFAULT_CHARSET
, data
->buffer
, s
->search_type
);
126 mctest_assert_true (retval
);
130 mctest_assert_false (retval
);
136 END_PARAMETRIZED_TEST
139 /* --------------------------------------------------------------------------------------------- */
146 tc_core
= tcase_create ("Core");
148 /* Add new tests here: *************** */
149 mctest_add_parameterized_test (tc_core
, test_regex_multiline_str
, test_regex_multiline_str_ds
);
150 /* *********************************** */
152 return mctest_run_all (tc_core
);
155 /* --------------------------------------------------------------------------------------------- */