Skip to content

Commit

Permalink
Add regression test for #233
Browse files Browse the repository at this point in the history
  • Loading branch information
sahib committed Jun 8, 2017
1 parent 7d9a216 commit c54b620
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,8 +1193,10 @@ static gboolean rm_cmd_parse_replay(_UNUSED const char *option_name,
static gboolean rm_cmd_parse_equal(_UNUSED const char *option_name,
_UNUSED const gchar *x, RmSession *session,
_UNUSED GError **error) {
rm_cmd_parse_merge_directories(NULL, NULL, session, error);
rm_cmd_parse_merge_directories(NULL, NULL, session, error);
session->cfg->run_equal_mode = true;

/* See issue #233; partial hidden needs to be disabled */
session->cfg->partial_hidden = false;
session->cfg->ignore_hidden = false;

Expand Down
6 changes: 3 additions & 3 deletions lib/formats/sh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ fi

if [ ! -z $DO_DRY_RUN ]
then
echo $COL_YELLOW "# ////////////////////////////////////////////////////////////" $COL_RESET
echo $COL_YELLOW "# ///" $COL_RESET "This is only a dry run; nothing will be modified! " $COL_YELLOW "///" $COL_RESET
echo $COL_YELLOW "# ////////////////////////////////////////////////////////////" $COL_RESET
echo "#$COL_YELLOW ////////////////////////////////////////////////////////////" $COL_RESET
echo "#$COL_YELLOW ///" $COL_RESET "This is only a dry run; nothing will be modified! " $COL_YELLOW "///" $COL_RESET
echo "#$COL_YELLOW ////////////////////////////////////////////////////////////" $COL_RESET
echo
fi

Expand Down
14 changes: 14 additions & 0 deletions tests/test_options/test_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,17 @@ def test_dir_and_file():
head, *data, footer = run_rmlint(
'--equal', path_a, path_b
)


# Regression test for Issue #233
@with_setup(usual_setup_func, usual_teardown_func)
def test_equal_hidden_dirs():
path_a = os.path.dirname(create_file('xxx', 'dir_a/x'))
path_b = os.path.dirname(create_file('xxx', '.dir_b/.x'))

# This should fail since we should not mix directories with files,
# even if they have the same content.
with assert_exit_code(0):
head, *data, footer = run_rmlint(
'--equal', path_a, path_b
)

0 comments on commit c54b620

Please sign in to comment.