Skip to content
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
Choose a base branch
from
Open

Conversation

herveus
Copy link

@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.

    If it is a ref, dereference it before doing utf8::downgrade on it.
    This addresses issue libwww-perl#13 in GitHub
@karenetheridge
Copy link
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.

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
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants