mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
parent
610038f3bf
commit
f61bd3ca80
3 changed files with 13 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
|
|
||||||
|
if RUBY_ENGINE == 'truffleruby'
|
||||||
|
File.write("Makefile", dummy_makefile($srcdir).join(""))
|
||||||
|
else
|
||||||
create_makefile 'cgi/escape'
|
create_makefile 'cgi/escape'
|
||||||
|
end
|
||||||
|
|
|
@ -90,10 +90,13 @@ module CGI::Util
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TruffleRuby runs the pure-Ruby variant faster, do not use the C extension there
|
||||||
|
unless RUBY_ENGINE == 'truffleruby'
|
||||||
begin
|
begin
|
||||||
require 'cgi/escape'
|
require 'cgi/escape'
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Unescape a string that has been HTML-escaped
|
# Unescape a string that has been HTML-escaped
|
||||||
# CGI.unescapeHTML("Usage: foo "bar" <baz>")
|
# CGI.unescapeHTML("Usage: foo "bar" <baz>")
|
||||||
|
|
|
@ -262,7 +262,7 @@ class CGIUtilPureRubyTest < Test::Unit::TestCase
|
||||||
remove_method :escapeHTML
|
remove_method :escapeHTML
|
||||||
alias _unescapeHTML unescapeHTML
|
alias _unescapeHTML unescapeHTML
|
||||||
remove_method :unescapeHTML
|
remove_method :unescapeHTML
|
||||||
end
|
end if defined?(CGI::Escape)
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
|
@ -271,7 +271,7 @@ class CGIUtilPureRubyTest < Test::Unit::TestCase
|
||||||
remove_method :_escapeHTML
|
remove_method :_escapeHTML
|
||||||
alias unescapeHTML _unescapeHTML
|
alias unescapeHTML _unescapeHTML
|
||||||
remove_method :_unescapeHTML
|
remove_method :_unescapeHTML
|
||||||
end
|
end if defined?(CGI::Escape)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_cgi_escapeHTML_with_invalid_byte_sequence
|
def test_cgi_escapeHTML_with_invalid_byte_sequence
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue