{"action":"created","issue":{"url":"https://api.github.com/repos/Test-More/test-exception/issues/8","labels_url":"https://api.github.com/repos/Test-More/test-exception/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/Test-More/test-exception/issues/8/comments","events_url":"https://api.github.com/repos/Test-More/test-exception/issues/8/events","html_url":"https://github.com/Test-More/test-exception/pull/8","id":55977370,"number":8,"title":"Try to fix RT #81529","user":{"login":"pplu","id":53034,"avatar_url":"https://avatars.githubusercontent.com/u/53034?v=3","gravatar_id":"","url":"https://api.github.com/users/pplu","html_url":"https://github.com/pplu","followers_url":"https://api.github.com/users/pplu/followers","following_url":"https://api.github.com/users/pplu/following{/other_user}","gists_url":"https://api.github.com/users/pplu/gists{/gist_id}","starred_url":"https://api.github.com/users/pplu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pplu/subscriptions","organizations_url":"https://api.github.com/users/pplu/orgs","repos_url":"https://api.github.com/users/pplu/repos","events_url":"https://api.github.com/users/pplu/events{/privacy}","received_events_url":"https://api.github.com/users/pplu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-30T00:15:01Z","updated_at":"2015-12-30T21:08:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Test-More/test-exception/pulls/8","html_url":"https://github.com/Test-More/test-exception/pull/8","diff_url":"https://github.com/Test-More/test-exception/pull/8.diff","patch_url":"https://github.com/Test-More/test-exception/pull/8.patch"},"body":"I've written code to try to fix the case where you call throws_ok, the code doesn't die, and the test passes (RT#81529).\r\n\r\nThe test in t/Exception.t that doesn't throw (\"throws_ok: normal exit matched\") is failing due to this code change.\r\n\r\nJust thought you'd like to consider this new behaviour, since the original (passing the test) is very confusing."},"comment":{"url":"https://api.github.com/repos/Test-More/test-exception/issues/comments/168074028","html_url":"https://github.com/Test-More/test-exception/pull/8#issuecomment-168074028","issue_url":"https://api.github.com/repos/Test-More/test-exception/issues/8","id":168074028,"user":{"login":"exodist","id":73914,"avatar_url":"https://avatars.githubusercontent.com/u/73914?v=3","gravatar_id":"","url":"https://api.github.com/users/exodist","html_url":"https://github.com/exodist","followers_url":"https://api.github.com/users/exodist/followers","following_url":"https://api.github.com/users/exodist/following{/other_user}","gists_url":"https://api.github.com/users/exodist/gists{/gist_id}","starred_url":"https://api.github.com/users/exodist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exodist/subscriptions","organizations_url":"https://api.github.com/users/exodist/orgs","repos_url":"https://api.github.com/users/exodist/repos","events_url":"https://api.github.com/users/exodist/events{/privacy}","received_events_url":"https://api.github.com/users/exodist/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T21:08:30Z","updated_at":"2015-12-30T21:08:30Z","body":"I need to look a bit deeper. I suspect this will fail for code that actually throws a 0, or an empty string as an exception. Instead I think a fix will requite use of this pattern:\r\n\r\n    my $throws = !eval { $code->(); 1 };\r\n    my $error = $@;\r\n\r\n0, empty string, and undef are all valid as exceptions, so ultimately throws_ok will need to see if the eval passes or fails.\r\n\r\n    $ perl -e 'die undef'; perl -e 'die \"\"'; perl -e 'die 0'\r\n    Died at -e line 1.\r\n    Died at -e line 1.\r\n    0 at -e line 1.\r\n"}}