diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-12-26 20:14:20 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-12-26 20:15:00 +0100 |
commit | 60aa3d265e7bf4975810ba438754fcb33ed77f97 (patch) | |
tree | e9cd31f9c3acffe7ed8758b5df214f19432c2999 /testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch | |
parent | 6eb2f4b72e2a913c5b574219c1e3eada665a8d20 (diff) | |
download | aports-60aa3d265e7bf4975810ba438754fcb33ed77f97.tar.bz2 aports-60aa3d265e7bf4975810ba438754fcb33ed77f97.tar.xz |
testing/ruby-escape_utils: fix tests on Ruby 2.5
Diffstat (limited to 'testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch')
-rw-r--r-- | testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch b/testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch new file mode 100644 index 0000000000..0579a99ab6 --- /dev/null +++ b/testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch @@ -0,0 +1,27 @@ +CGI.escape does not escape "~" since Ruby 2.5. + +--- a/test/uri_component/escape_test.rb ++++ b/test/uri_component/escape_test.rb +@@ -10,8 +10,9 @@ + (0..127).each do |i| + c = i.chr + # Escaping URI path components should match CGI parameter escaping, except +- # spaces should be escaped as "%20" instead of "+" +- assert_equal CGI.escape(c).sub("+", "%20"), EscapeUtils.escape_uri_component(c) ++ # spaces should be escaped as "%20" instead of "+" and "~" should be ++ # escaped as "%7E". ++ assert_equal CGI.escape(c).sub("+", "%20").sub("~", "%7E"), EscapeUtils.escape_uri_component(c) + end + end + +--- a/test/url/escape_test.rb ++++ b/test/url/escape_test.rb +@@ -9,7 +9,7 @@ + def test_cgi_stdlib_compatibility + (0..127).each do |i| + c = i.chr +- assert_equal CGI.escape(c), EscapeUtils.escape_url(c) ++ assert_equal CGI.escape(c).sub("~", "%7E"), EscapeUtils.escape_url(c) + end + end + |