{"action":"created","issue":{"url":"https://api.github.com/repos/ocsigen/lwt/issues/512","repository_url":"https://api.github.com/repos/ocsigen/lwt","labels_url":"https://api.github.com/repos/ocsigen/lwt/issues/512/labels{/name}","comments_url":"https://api.github.com/repos/ocsigen/lwt/issues/512/comments","events_url":"https://api.github.com/repos/ocsigen/lwt/issues/512/events","html_url":"https://github.com/ocsigen/lwt/pull/512","id":284226980,"number":512,"title":"Issue 395: Add tests for exception handling behavior of Lwt_list functions.","user":{"login":"jsthomas","id":14198704,"avatar_url":"https://avatars3.githubusercontent.com/u/14198704?v=4","gravatar_id":"","url":"https://api.github.com/users/jsthomas","html_url":"https://github.com/jsthomas","followers_url":"https://api.github.com/users/jsthomas/followers","following_url":"https://api.github.com/users/jsthomas/following{/other_user}","gists_url":"https://api.github.com/users/jsthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/jsthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsthomas/subscriptions","organizations_url":"https://api.github.com/users/jsthomas/orgs","repos_url":"https://api.github.com/users/jsthomas/repos","events_url":"https://api.github.com/users/jsthomas/events{/privacy}","received_events_url":"https://api.github.com/users/jsthomas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-22T18:40:25Z","updated_at":"2017-12-22T20:57:17Z","closed_at":"2017-12-22T20:57:08Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ocsigen/lwt/pulls/512","html_url":"https://github.com/ocsigen/lwt/pull/512","diff_url":"https://github.com/ocsigen/lwt/pull/512.diff","patch_url":"https://github.com/ocsigen/lwt/pull/512.patch"},"body":"This change addresses the first of three parts of #395, testing how functions in `Lwt_list` respond to exceptions. \r\n\r\nThe functions `map_p`, `map_s`, `iter_p`, and `iter_i` were already tested by a base testing function `test_exception`. The tests introduced here make use of that same function, which verifies that if an exception `E` occurs when running something like `Lwt_list.map_p f l`, then the promise evaluates to `Lwt.Fail E` (and the exception doesn't propagate any farther).\r\n\r\nIn the course of writing my tests, I found that this exception handling behavior is **not** consistent across all `Lwt_list` functions in their current implementation. For example, an exception arising in the course of running `Lwt_list.mapi_p f l` gets propagated up to the caller; you would need to surround it with a `try ... catch` to handle it. In my (inexpert) opinion, the behavior tested by `test_exception` seems like the right design.\r\n\r\nThe first commit in this PR sets up the tests to verify every function in `Lwt_list` follows the convention defined in `test_exception` and the second commit modifies `Lwt_list` to make the tests pass."},"comment":{"url":"https://api.github.com/repos/ocsigen/lwt/issues/comments/353673469","html_url":"https://github.com/ocsigen/lwt/pull/512#issuecomment-353673469","issue_url":"https://api.github.com/repos/ocsigen/lwt/issues/512","id":353673469,"user":{"login":"aantron","id":12073668,"avatar_url":"https://avatars2.githubusercontent.com/u/12073668?v=4","gravatar_id":"","url":"https://api.github.com/users/aantron","html_url":"https://github.com/aantron","followers_url":"https://api.github.com/users/aantron/followers","following_url":"https://api.github.com/users/aantron/following{/other_user}","gists_url":"https://api.github.com/users/aantron/gists{/gist_id}","starred_url":"https://api.github.com/users/aantron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aantron/subscriptions","organizations_url":"https://api.github.com/users/aantron/orgs","repos_url":"https://api.github.com/users/aantron/repos","events_url":"https://api.github.com/users/aantron/events{/privacy}","received_events_url":"https://api.github.com/users/aantron/received_events","type":"User","site_admin":false},"created_at":"2017-12-22T20:57:17Z","updated_at":"2017-12-22T20:57:17Z","author_association":"COLLABORATOR","body":"Thanks! This fixes a ton of bugs in `Lwt_list`. I'm squash-merging the commits, to avoid adding a point in history where the build would fail (this harms bisecting)."}}
{"actor":{"display_login":"aantron"}}