Skip to content

Conversation

ashie
Copy link
Collaborator

@ashie ashie commented Jul 5, 2021

No description provided.

@ashie ashie force-pushed the fix-jruby-support branch from 444664d to cbb0f70 Compare July 5, 2021 00:42
@ashie
Copy link
Collaborator Author

ashie commented Jul 5, 2021

5 tests are fixed by #63 but still following 4 tests are failed:

Failures:

  1) HTTP::Parser should optionally reset parser state on no-body responses
     Failure/Error: expect(@complete).to eq(1)
     
       expected: 1
            got: 0
     
       (compared using ==)
     # ./spec/parser_spec.rb:198:in `block in <main>'

  2) HTTP::Parser should ignore extra content beyond specified length
     Failure/Error: @parser <<
     
     HTTP::Parser::Error:
       Connection already closed
     # org/ruby_http_parser/RubyHttpParser.java:379:in `<<'
     # ./spec/parser_spec.rb:301:in `block in <main>'

  3) HTTP::Parser should parse request: line folding in header value
     Failure/Error: expect(@headers).to eq(test['headers'])
     
       expected: {"Line1"=>"abc\tdef ghi\t\tjkl mno \t \tqrs", "Line2"=>"line2\t"}
            got: {"Line1"=>"abcdefghijklmno qrs", "Line2"=>"line2\t"}
     
       (compared using ==)
     
       Diff:
       @@ -1 +1 @@
       -"Line1" => "abc\tdef ghi\t\tjkl mno \t \tqrs",
       +"Line1" => "abcdefghijklmno qrs",
       
     # ./spec/parser_spec.rb:394:in `block in <main>'

  4) HTTP::Parser should parse request: utf-8 path request
     Failure/Error: expect(@parser.send("request_url")).to eq(test["request_url"].force_encoding(Encoding::BINARY))
     
       expected: "/\xCE\xB4\xC2\xB6/\xCE\xB4t/pope?q=1#narf"
            got: "/δ¶/δt/pope?q=1#narf"
     
       (compared using ==)
     # ./spec/parser_spec.rb:387:in `block in <main>'

@ashie ashie changed the title Fix JRuby support JRuby: Revert unimplemented "status" support and fix an failed test Sep 1, 2021
@ashie
Copy link
Collaborator Author

ashie commented Sep 1, 2021

Although there are still 3 failed tests, I'll merge this branch to master.
I'll continue to check remaining failed tests in another pull request.

This reverts commit 68e549f.

Because it's not implemented in http-parser.java. How was it tested?
It may be revived later when we implement it in our forked version.

Signed-off-by: Takuro Ashie <[email protected]>
Signed-off-by: Takuro Ashie <[email protected]>
In CRuby, they are ASCII_8BIT since they are created by rb_str_new().
On the other hand, they are UTF-8 in JRuby.

Fix the following failed test on JRuby:

  4) HTTP::Parser should parse request: utf-8 path request
     Failure/Error: expect(@parser.send("request_url")).to eq(test["request_url"].force_encoding(Encoding::BINARY))

       expected: "/\xCE\xB4\xC2\xB6/\xCE\xB4t/pope?q=1#narf"
            got: "/δ¶/δt/pope?q=1#narf"

       (compared using ==)
     # ./spec/parser_spec.rb:387:in `block in <main>'

Although they should use same encoding, I don't fix it for now to keep
backward compatibility.

Signed-off-by: Takuro Ashie <[email protected]>
Temporally disable JRuby tests to merge #73

This reverts commit 3c372c7.
@ashie ashie force-pushed the fix-jruby-support branch from c8e803f to 1d76de1 Compare September 1, 2021 08:46
@ashie ashie marked this pull request as ready for review September 1, 2021 08:46
@ashie ashie merged commit 03ff166 into master Sep 1, 2021
@ashie ashie deleted the fix-jruby-support branch September 1, 2021 08:49
@ashie ashie mentioned this pull request Sep 1, 2021
@ashie
Copy link
Collaborator Author

ashie commented Sep 1, 2021

I'll continue to check remaining failed tests in another pull request.

#75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant