Wakou Aoyama <wakou / fsinet.or.jp> wrote in message news:<20020520144456.GA1357%wakou / fsinet.or.jp>...
> Unfortunately I don't make it.
> 
> I use mini test.
> 
> #!/usr/local/bin/ruby -w
> 
> ENV['REQUEST_METHOD'] = 'GET'
> ENV['QUERY_STRING'] = 'query1=%7Evalue1&query2=value1&query2=value2'
> ENV['HTTP_COOKIE'] = 'cookie1=%7Evalue1; cookie2=value1&value2'
> 
> require "cgi"
> cgi = CGI.new
> 
> p CGI::parse('query1=%7Evalue1&query2=value1&query2=value2') ==
>     {"query1"=>["~value1"], "query2"=>["value1", "value2"]}
> p CGI::escape('!@$%^&*()') == '%21%40%24%25%5E%26%2A%28%29'
> p CGI::unescape('%21%40%24%25%5E%26%2A%28%29') == '!@$%^&*()'
> p CGI::escapeHTML('&"<>') == '&amp;&quot;&lt;&gt;'
> p CGI::unescapeHTML('&amp;&quot;&lt;&gt;') == '&"<>'
> p CGI::escapeElement('<HTML>', 'HTML') == '&lt;HTML&gt;'
> p CGI::unescapeElement('&lt;HTML&gt;', 'HTML') == '<HTML>'
> p cgi.params == {"query1"=>["~value1"], "query2"=>["value1", "value2"]}
> p cgi.cookies["cookie1"] == ["~value1"] and
>     cgi.cookies["cookie2"] == ["value1", "value2"]
> 
> etc...

These look great!  I want to merge cgi.rb with the api that I've been
thinking about with narf.  It would be easier to make things
compatible if I had the tests for the old cgi.

I don't mind converting the tests to unit tests for my purposes.

If you don't mind, could you send me these tests or point me to where
I could download them?

Thanks,

Patrick