In order to use multiline search, select "Regular expression" mode and
use "\n" in the input line:
For example, if file contains lines
aaa
bbb
search string should be "aaa\nbbb".
As a side effect, non-printable ASCII symbols (\r, \t, etc) in the
search string can be used too.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(filevercmp_test5): rename variables. START_TEST macro uses the variable
name _i, so GCC complains about redefining it with a different type
here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
filevercmp: don't treat entire filename as suffix.
Sync with gnulib 1ba2b66ea45f9bc43cdc0f6f93efa59157d2b2ba.
(file_prefixlen): When stripping (\.[A-Za-z~][A-Za-z0-9~]*)*$ suffixes,
do not strip the entire file name.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Sync with gnulib 9f48fb992a3d7e96610c4ce8be969cff2d61a01b.
Problems reported by Michael Debertol in <https://bugs.gnu.org/49239>.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Use ck_assert_int_lt() and ck_assert_int_gt() to check integer values.
Increase minimal version of Check up to 0.9.10.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Remove mc-specific macros mctest_assert_int_eq and mctest_assert_int_ne.
Use ck_assert_int_eq() and ck_assert_int_ne() functions respectively.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
The mc's built-in samba library which is used to access data across
smb links is taken from an old samba version.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Add two widget callbacks:
* (make_global): convert widget coordinates from local (relative to
owner) to global (screen).
* (make_local): convert widget coordinates from global (screen) to
local (relative to owner).
Such conversions are required when nested widgets and groups are added to
or removed from another groups.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
libcheck fail_unless() is deprecated since 0.10.0.
Also fix -Wformat-extra-args warnings.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
libcheck fail() is deprecated since 0.10.0.
Also fix -Wformat-extra-args warnings.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
hex_translate_to_regex.c: In function 'test_hex_translate_to_regex_fn':
hex_translate_to_regex.c:172:9: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
172 | mctest_assert_int_eq (error, data->expected_error);
| ^
hex_translate_to_regex.c:154:33: note: 'error' was declared here
154 | mc_search_hex_parse_error_t error;
| ^
Found by gcc-9.3.0
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...to free or not to free the string representation
of vfs_path_t object.
It allows to get rid of string duplication in following cases:
vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = g_strdup (vfs_path_as_str (vpath));
vfs_path_free (vpath);
Now we can write:
vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = vfs_path_free (vpath, FALSE);
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Custom .zshrc file is ~/.local/share/mc/.zshrc.
If ZDOTDIR environment variable is not set, set it to ~/.local/share/mc
if a .zshrc is found there. It is the only way to point zsh to an other
rc file than the default.
Thanks Sebastian Gniazdowski <sgniazdowski@gmail.com> for the original
patch.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Since automake-1.12 (test-driver script) libcheck logfile is written
parallel by automake.
Print test logging to stdout and let write to logfile by automake only.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(edit_collect_completions): return GQueue. Use GQueue inside.
Do not return an empty queue, create it if needed only.
(edit_complete_word_cmd): Use GQueue inside. Ged rid of limitation
of completions count. Rename variable.
(editcmd_dialog_completion_show): take GQueue. Rename and reorder
arguments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Don't wanna accidentially add autogenerated files to the git repo,
so ignore them.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...after refactoring of SIGWINCH handling
(37ffc02422).
Replacing variable with pipe cause a timeout in original tty_got_winch()
in this test and test fails. Use an empty replacement of mc_refresh().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
As will be explained in a following commit, our rpm helper has a bug stemming
from the use of 'echo'.
Before we fix it, we update the test's "expected output" to reflect the
intended output (as it's currently reflects a faulty output).
Signed-off-by: Mooffie <mooffie@gmail.com>
The "expected output" files we provide must be generated in the same locale the
tester (that is, the helpers) are run. Otherwise helpers using the 'sort'
utility may generate output different than our provided "expected output",
hence failing the tests.
Therefore we:
(1) Regenerate the "expected output" files in the C locale.
(2) Make sure the tester is run in the C locale.
(Tip: to regenerate the "expected output" files we deleted all the *.output
files and run the tester with "LC_ALL=C ./run --create-output".)
Signed-off-by: Mooffie <mooffie@gmail.com>
We update our .output file to include the entries
`INFO/SCRIPTS/{PRE,POST}TRANS[PROG]`, which the rpm helper now emits.
(Tip: here's how we do this: we delete the output file and recreate it by
running the tester thus: "./run --create-output".)
Signed-off-by: Mooffie <mooffie@gmail.com>
In the future we will probably place each helper's tests in a separate folder.
We'll then get rid of this 'misc/rpm' folder by moving it there.
Signed-off-by: Mooffie <mooffie@gmail.com>
We use a 'spec' contributed by Jiri Tyr.
We keep the previous test (by renaming rpm.* to rpm.glib.*), though, in case
somebody wants to work on data from "the real world".
Signed-off-by: Mooffie <mooffie@gmail.com>
This is a preliminary step before being able to write tests for our rpm helper.
We introduce 'rpm2tags', a tool for converting RPM packages to parsable text
files. This will enable us to write tests that can run even where the 'rpm'
program isn't installed.
Signed-off-by: Mooffie <mooffie@gmail.com>
We introduce a mechanism by which tests can easily access configure-time
parameters (like @PERL@, @AWK@, ...).
It works by "sourcing" a file named config.sh (residing in the build tree):
. "$MC_TEST_EXTFS_CONFIG_SH"
$PERL -e 'print "hello"'
(Although config.sh has a shell syntax, Perl and Python programs too can
benefit from it, because it can be sourced into an .env_vars file and the
values exported from there.)
Of course, one can also use the traditional method, of *.in files listed in
configure.ac, but the mechanism introduced here is a more comfortable approach.
Signed-off-by: Mooffie <mooffie@gmail.com>
- We now have 4'th level headers: adjust --doc-depth.
- We have many short sections: highlight the active section's header.
Signed-off-by: Mooffie <mooffie@gmail.com>