New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ref content #23

Open
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@herveus

herveus commented May 31, 2015

Issue #13 in Github identified a problem when new() is passed $content as a ref. In particular, it seems that utf8_downgrade doesn't get properly done. My fix was to have new capture the new object and if the content is a ref, then call content_ref to set it using the existing logic.

herveus added some commits Apr 23, 2015

Modified HTTP::Message::new to check $content to see if it is a ref.
    If it is a ref, dereference it before doing utf8::downgrade on it.
    This addresses issue #13 in GitHub
@karenetheridge

This comment has been minimized.

Show comment
Hide comment
@karenetheridge

karenetheridge May 31, 2015

Member

Any change in functionality should be covered by a test case that fails before the associated .pm change is applied, so we can be sure not to regress the change. It also helps demonstrate the intent behind the change for future readers.

Member

karenetheridge commented May 31, 2015

Any change in functionality should be covered by a test case that fails before the associated .pm change is applied, so we can be sure not to regress the change. It also helps demonstrate the intent behind the change for future readers.

Added test to t/message.t
prove t/message.t
t/message.t .. 1/131 # Test 131 got: <UNDEF> (t/message.t at line 500)
t/message.t .. Failed 1/131 subtests

Test Summary Report
-------------------
t/message.t (Wstat: 0 Tests: 131 Failed: 1)
  Failed test:  131
Files=1, Tests=131,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.09 cusr  0.00 csys =  0.11 CPU)
Result: FAIL

prove -b t/message.t
t/message.t .. ok
All tests successful.
Files=1, Tests=131,  1 wallclock secs ( 0.03 usr  0.01 sys +  0.09 cusr  0.00 csys =  0.13 CPU)
Result: PASS
@herveus

This comment has been minimized.

Show comment
Hide comment
@herveus

herveus May 31, 2015

Ah. I've added a test that fails on 6.06 and passes with this fix. Is this sufficient to move forward?

Thanks for your patience...

herveus commented May 31, 2015

Ah. I've added a test that fails on 6.06 and passes with this fix. Is this sufficient to move forward?

Thanks for your patience...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment