Skip to content

Commit

Permalink
Fix test failure under ruby2.7
Browse files Browse the repository at this point in the history
In ruby2.7 `+` is no longer escaped ShellWords.shellescape. In order to
make this test pass on ruby2.7 but also on older versions, drop the +
the string that is expected to be escaped.

Fixes #50
  • Loading branch information
terceiro committed Apr 3, 2020
1 parent eecfb3e commit 6a4745c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def prepare_directory(path, mode=0777, mtime=Time.now, atime=Time.now)
# handles newlines just fine, so we can be reasonably confident that they
# will work in practice
def awful_file_name
(((0x00..0x7f).to_a - [0x00, 0x0a, 0x2f]).map { |n| n.chr }).join + '.txt'
(((0x00..0x7f).to_a - [0x00, 0x0a, 0x2b, 0x2f]).map { |n| n.chr }).join + '.txt'
end

def escaped_file_name
"\\\001\\\002\\\003\\\004\\\005\\\006\\\a\\\b\\\t\\\v\\\f\\\r\\\016\\\017\\\020\\\021\\\022\\\023\\\024\\\025\\\026\\\027\\\030\\\031\\\032\\\e\\\034\\\035\\\036\\\037\\ \\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+,-.0123456789:\\;\\<\\=\\>\\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[\\\\\\]\\^_\\`abcdefghijklmnopqrstuvwxyz\\{\\|\\}\\~\\\177.txt"
"\\\001\\\002\\\003\\\004\\\005\\\006\\\a\\\b\\\t\\\v\\\f\\\r\\\016\\\017\\\020\\\021\\\022\\\023\\\024\\\025\\\026\\\027\\\030\\\031\\\032\\\e\\\034\\\035\\\036\\\037\\ \\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*,-.0123456789:\\;\\<\\=\\>\\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[\\\\\\]\\^_\\`abcdefghijklmnopqrstuvwxyz\\{\\|\\}\\~\\\177.txt"
end

class FileEntry
Expand Down

0 comments on commit 6a4745c

Please sign in to comment.