{"action":"created","comment":{"url":"https://api.github.com/repos/jneen/parsimmon/pulls/comments/197881934","pull_request_review_id":131712623,"id":197881934,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Nzg4MTkzNA==","diff_hunk":"@@ -369,4 +369,60 @@ suite(\"formatError\", function() {\n \n     assert.deepEqual(answer, expectation);\n   });\n+\n+  test(\"error marker is padded with correctly in an error on a fourth byte\", function() {\n+    var parser = Parsimmon.seq(\n+      Parsimmon.Binary.byte(0x01),\n+      Parsimmon.Binary.byte(0x00),\n+      Parsimmon.Binary.byte(0x00),\n+      Parsimmon.Binary.byte(0x02),\n+      Parsimmon.Binary.byte(0x01)\n+    );\n+\n+    var expectation =\n+      \"\\n\" +\n+      \"-- PARSING FAILED --------------------------------------------------\\n\" +\n+      \"\\n\" +\n+      \"> 00 | 01 00 00 03  00\\n\" +\n+      \"     |          ^^\\n\" +\n+      \"\\n\" +\n+      \"Expected:\\n\" +\n+      \"\\n\" +\n+      \"0x02\" +\n+      \"\\n\";\n+\n+    var input = Buffer.from([0x01, 0x00, 0x00, 0x03, 0x00]);\n+\n+    var answer = Parsimmon.formatError(input, parser.parse(input));\n+\n+    assert.deepEqual(answer, expectation);\n+  });\n+\n+  test(\"error marker is padded with correctly in an error on a fifth byte\", function() {\n+    var parser = Parsimmon.seq(\n+      Parsimmon.Binary.byte(0x01),\n+      Parsimmon.Binary.byte(0x00),\n+      Parsimmon.Binary.byte(0x00),\n+      Parsimmon.Binary.byte(0x02),\n+      Parsimmon.Binary.byte(0x01)\n+    );\n+\n+    var expectation =\n+      \"\\n\" +\n+      \"-- PARSING FAILED --------------------------------------------------\\n\" +\n+      \"\\n\" +\n+      \"> 00 | 01 00 00 02  00\\n\" +\n+      \"     |              ^^\\n\" +\n+      \"\\n\" +\n+      \"Expected:\\n\" +\n+      \"\\n\" +\n+      \"0x01\" +\n+      \"\\n\";\n+\n+    var input = Buffer.from([0x01, 0x00, 0x00, 0x02, 0x00]);\n+\n+    var answer = Parsimmon.formatError(input, parser.parse(input));\n+\n+    assert.deepEqual(answer, expectation);\n+  });","path":"test/core/formatError.test.js","position":31,"original_position":59,"commit_id":"dae1df339f54686915eaf06adee4ada96b395ac8","original_commit_id":"dae1df339f54686915eaf06adee4ada96b395ac8","user":{"login":"wavebeem","id":176815,"node_id":"MDQ6VXNlcjE3NjgxNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/176815?v=4","gravatar_id":"","url":"https://api.github.com/users/wavebeem","html_url":"https://github.com/wavebeem","followers_url":"https://api.github.com/users/wavebeem/followers","following_url":"https://api.github.com/users/wavebeem/following{/other_user}","gists_url":"https://api.github.com/users/wavebeem/gists{/gist_id}","starred_url":"https://api.github.com/users/wavebeem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wavebeem/subscriptions","organizations_url":"https://api.github.com/users/wavebeem/orgs","repos_url":"https://api.github.com/users/wavebeem/repos","events_url":"https://api.github.com/users/wavebeem/events{/privacy}","received_events_url":"https://api.github.com/users/wavebeem/received_events","type":"User","site_admin":false},"body":"thank you for the thorough tests!!","created_at":"2018-06-25T17:42:45Z","updated_at":"2018-06-25T17:42:51Z","html_url":"https://github.com/jneen/parsimmon/pull/262#discussion_r197881934","pull_request_url":"https://api.github.com/repos/jneen/parsimmon/pulls/262","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/jneen/parsimmon/pulls/comments/197881934"},"html":{"href":"https://github.com/jneen/parsimmon/pull/262#discussion_r197881934"},"pull_request":{"href":"https://api.github.com/repos/jneen/parsimmon/pulls/262"}}},"pull_request":{"url":"https://api.github.com/repos/jneen/parsimmon/pulls/262","id":197186345,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3MTg2MzQ1","html_url":"https://github.com/jneen/parsimmon/pull/262","diff_url":"https://github.com/jneen/parsimmon/pull/262.diff","patch_url":"https://github.com/jneen/parsimmon/pull/262.patch","issue_url":"https://api.github.com/repos/jneen/parsimmon/issues/262","number":262,"state":"open","locked":false,"title":"Fix error formatting bug","user":{"login":"halfzebra","id":3983879,"node_id":"MDQ6VXNlcjM5ODM4Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/3983879?v=4","gravatar_id":"","url":"https://api.github.com/users/halfzebra","html_url":"https://github.com/halfzebra","followers_url":"https://api.github.com/users/halfzebra/followers","following_url":"https://api.github.com/users/halfzebra/following{/other_user}","gists_url":"https://api.github.com/users/halfzebra/gists{/gist_id}","starred_url":"https://api.github.com/users/halfzebra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfzebra/subscriptions","organizations_url":"https://api.github.com/users/halfzebra/orgs","repos_url":"https://api.github.com/users/halfzebra/repos","events_url":"https://api.github.com/users/halfzebra/events{/privacy}","received_events_url":"https://api.github.com/users/halfzebra/received_events","type":"User","site_admin":false},"body":"Addresses a bug discovered by @wavebeem in issue #239 \r\n\r\nIntroduces tests and minor refactoring.","created_at":"2018-06-25T17:40:28Z","updated_at":"2018-06-25T17:42:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87ae801ccf362f2acfccd26ac2abe99e15119911","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jneen/parsimmon/pulls/262/commits","review_comments_url":"https://api.github.com/repos/jneen/parsimmon/pulls/262/comments","review_comment_url":"https://api.github.com/repos/jneen/parsimmon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jneen/parsimmon/issues/262/comments","statuses_url":"https://api.github.com/repos/jneen/parsimmon/statuses/dae1df339f54686915eaf06adee4ada96b395ac8","head":{"label":"halfzebra:fix-error-formatting","ref":"fix-error-formatting","sha":"dae1df339f54686915eaf06adee4ada96b395ac8","user":{"login":"halfzebra","id":3983879,"node_id":"MDQ6VXNlcjM5ODM4Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/3983879?v=4","gravatar_id":"","url":"https://api.github.com/users/halfzebra","html_url":"https://github.com/halfzebra","followers_url":"https://api.github.com/users/halfzebra/followers","following_url":"https://api.github.com/users/halfzebra/following{/other_user}","gists_url":"https://api.github.com/users/halfzebra/gists{/gist_id}","starred_url":"https://api.github.com/users/halfzebra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfzebra/subscriptions","organizations_url":"https://api.github.com/users/halfzebra/orgs","repos_url":"https://api.github.com/users/halfzebra/repos","events_url":"https://api.github.com/users/halfzebra/events{/privacy}","received_events_url":"https://api.github.com/users/halfzebra/received_events","type":"User","site_admin":false},"repo":{"id":127774630,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc3NzQ2MzA=","name":"parsimmon","full_name":"halfzebra/parsimmon","owner":{"login":"halfzebra","id":3983879,"node_id":"MDQ6VXNlcjM5ODM4Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/3983879?v=4","gravatar_id":"","url":"https://api.github.com/users/halfzebra","html_url":"https://github.com/halfzebra","followers_url":"https://api.github.com/users/halfzebra/followers","following_url":"https://api.github.com/users/halfzebra/following{/other_user}","gists_url":"https://api.github.com/users/halfzebra/gists{/gist_id}","starred_url":"https://api.github.com/users/halfzebra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfzebra/subscriptions","organizations_url":"https://api.github.com/users/halfzebra/orgs","repos_url":"https://api.github.com/users/halfzebra/repos","events_url":"https://api.github.com/users/halfzebra/events{/privacy}","received_events_url":"https://api.github.com/users/halfzebra/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/halfzebra/parsimmon","description":"A monadic LL(infinity) parser combinator library for javascript","fork":true,"url":"https://api.github.com/repos/halfzebra/parsimmon","forks_url":"https://api.github.com/repos/halfzebra/parsimmon/forks","keys_url":"https://api.github.com/repos/halfzebra/parsimmon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/halfzebra/parsimmon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/halfzebra/parsimmon/teams","hooks_url":"https://api.github.com/repos/halfzebra/parsimmon/hooks","issue_events_url":"https://api.github.com/repos/halfzebra/parsimmon/issues/events{/number}","events_url":"https://api.github.com/repos/halfzebra/parsimmon/events","assignees_url":"https://api.github.com/repos/halfzebra/parsimmon/assignees{/user}","branches_url":"https://api.github.com/repos/halfzebra/parsimmon/branches{/branch}","tags_url":"https://api.github.com/repos/halfzebra/parsimmon/tags","blobs_url":"https://api.github.com/repos/halfzebra/parsimmon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/halfzebra/parsimmon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/halfzebra/parsimmon/git/refs{/sha}","trees_url":"https://api.github.com/repos/halfzebra/parsimmon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/halfzebra/parsimmon/statuses/{sha}","languages_url":"https://api.github.com/repos/halfzebra/parsimmon/languages","stargazers_url":"https://api.github.com/repos/halfzebra/parsimmon/stargazers","contributors_url":"https://api.github.com/repos/halfzebra/parsimmon/contributors","subscribers_url":"https://api.github.com/repos/halfzebra/parsimmon/subscribers","subscription_url":"https://api.github.com/repos/halfzebra/parsimmon/subscription","commits_url":"https://api.github.com/repos/halfzebra/parsimmon/commits{/sha}","git_commits_url":"https://api.github.com/repos/halfzebra/parsimmon/git/commits{/sha}","comments_url":"https://api.github.com/repos/halfzebra/parsimmon/comments{/number}","issue_comment_url":"https://api.github.com/repos/halfzebra/parsimmon/issues/comments{/number}","contents_url":"https://api.github.com/repos/halfzebra/parsimmon/contents/{+path}","compare_url":"https://api.github.com/repos/halfzebra/parsimmon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/halfzebra/parsimmon/merges","archive_url":"https://api.github.com/repos/halfzebra/parsimmon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/halfzebra/parsimmon/downloads","issues_url":"https://api.github.com/repos/halfzebra/parsimmon/issues{/number}","pulls_url":"https://api.github.com/repos/halfzebra/parsimmon/pulls{/number}","milestones_url":"https://api.github.com/repos/halfzebra/parsimmon/milestones{/number}","notifications_url":"https://api.github.com/repos/halfzebra/parsimmon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/halfzebra/parsimmon/labels{/name}","releases_url":"https://api.github.com/repos/halfzebra/parsimmon/releases{/id}","deployments_url":"https://api.github.com/repos/halfzebra/parsimmon/deployments","created_at":"2018-04-02T15:25:50Z","updated_at":"2018-06-25T07:50:03Z","pushed_at":"2018-06-25T17:36:56Z","git_url":"git://github.com/halfzebra/parsimmon.git","ssh_url":"git@github.com:halfzebra/parsimmon.git","clone_url":"https://github.com/halfzebra/parsimmon.git","svn_url":"https://github.com/halfzebra/parsimmon","homepage":null,"size":748,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jneen:master","ref":"master","sha":"5a5dbc2f966e36b09eacf50328024767c2f4bc4d","user":{"login":"jneen","id":225017,"node_id":"MDQ6VXNlcjIyNTAxNw==","avatar_url":"https://avatars1.githubusercontent.com/u/225017?v=4","gravatar_id":"","url":"https://api.github.com/users/jneen","html_url":"https://github.com/jneen","followers_url":"https://api.github.com/users/jneen/followers","following_url":"https://api.github.com/users/jneen/following{/other_user}","gists_url":"https://api.github.com/users/jneen/gists{/gist_id}","starred_url":"https://api.github.com/users/jneen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jneen/subscriptions","organizations_url":"https://api.github.com/users/jneen/orgs","repos_url":"https://api.github.com/users/jneen/repos","events_url":"https://api.github.com/users/jneen/events{/privacy}","received_events_url":"https://api.github.com/users/jneen/received_events","type":"User","site_admin":false},"repo":{"id":6752066,"node_id":"MDEwOlJlcG9zaXRvcnk2NzUyMDY2","name":"parsimmon","full_name":"jneen/parsimmon","owner":{"login":"jneen","id":225017,"node_id":"MDQ6VXNlcjIyNTAxNw==","avatar_url":"https://avatars1.githubusercontent.com/u/225017?v=4","gravatar_id":"","url":"https://api.github.com/users/jneen","html_url":"https://github.com/jneen","followers_url":"https://api.github.com/users/jneen/followers","following_url":"https://api.github.com/users/jneen/following{/other_user}","gists_url":"https://api.github.com/users/jneen/gists{/gist_id}","starred_url":"https://api.github.com/users/jneen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jneen/subscriptions","organizations_url":"https://api.github.com/users/jneen/orgs","repos_url":"https://api.github.com/users/jneen/repos","events_url":"https://api.github.com/users/jneen/events{/privacy}","received_events_url":"https://api.github.com/users/jneen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jneen/parsimmon","description":"A monadic LL(infinity) parser combinator library for javascript","fork":false,"url":"https://api.github.com/repos/jneen/parsimmon","forks_url":"https://api.github.com/repos/jneen/parsimmon/forks","keys_url":"https://api.github.com/repos/jneen/parsimmon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jneen/parsimmon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jneen/parsimmon/teams","hooks_url":"https://api.github.com/repos/jneen/parsimmon/hooks","issue_events_url":"https://api.github.com/repos/jneen/parsimmon/issues/events{/number}","events_url":"https://api.github.com/repos/jneen/parsimmon/events","assignees_url":"https://api.github.com/repos/jneen/parsimmon/assignees{/user}","branches_url":"https://api.github.com/repos/jneen/parsimmon/branches{/branch}","tags_url":"https://api.github.com/repos/jneen/parsimmon/tags","blobs_url":"https://api.github.com/repos/jneen/parsimmon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jneen/parsimmon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jneen/parsimmon/git/refs{/sha}","trees_url":"https://api.github.com/repos/jneen/parsimmon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jneen/parsimmon/statuses/{sha}","languages_url":"https://api.github.com/repos/jneen/parsimmon/languages","stargazers_url":"https://api.github.com/repos/jneen/parsimmon/stargazers","contributors_url":"https://api.github.com/repos/jneen/parsimmon/contributors","subscribers_url":"https://api.github.com/repos/jneen/parsimmon/subscribers","subscription_url":"https://api.github.com/repos/jneen/parsimmon/subscription","commits_url":"https://api.github.com/repos/jneen/parsimmon/commits{/sha}","git_commits_url":"https://api.github.com/repos/jneen/parsimmon/git/commits{/sha}","comments_url":"https://api.github.com/repos/jneen/parsimmon/comments{/number}","issue_comment_url":"https://api.github.com/repos/jneen/parsimmon/issues/comments{/number}","contents_url":"https://api.github.com/repos/jneen/parsimmon/contents/{+path}","compare_url":"https://api.github.com/repos/jneen/parsimmon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jneen/parsimmon/merges","archive_url":"https://api.github.com/repos/jneen/parsimmon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jneen/parsimmon/downloads","issues_url":"https://api.github.com/repos/jneen/parsimmon/issues{/number}","pulls_url":"https://api.github.com/repos/jneen/parsimmon/pulls{/number}","milestones_url":"https://api.github.com/repos/jneen/parsimmon/milestones{/number}","notifications_url":"https://api.github.com/repos/jneen/parsimmon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jneen/parsimmon/labels{/name}","releases_url":"https://api.github.com/repos/jneen/parsimmon/releases{/id}","deployments_url":"https://api.github.com/repos/jneen/parsimmon/deployments","created_at":"2012-11-18T22:25:59Z","updated_at":"2018-06-23T22:14:08Z","pushed_at":"2018-06-25T17:40:29Z","git_url":"git://github.com/jneen/parsimmon.git","ssh_url":"git@github.com:jneen/parsimmon.git","clone_url":"https://github.com/jneen/parsimmon.git","svn_url":"https://github.com/jneen/parsimmon","homepage":null,"size":772,"stargazers_count":615,"watchers_count":615,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":74,"open_issues":19,"watchers":615,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jneen/parsimmon/pulls/262"},"html":{"href":"https://github.com/jneen/parsimmon/pull/262"},"issue":{"href":"https://api.github.com/repos/jneen/parsimmon/issues/262"},"comments":{"href":"https://api.github.com/repos/jneen/parsimmon/issues/262/comments"},"review_comments":{"href":"https://api.github.com/repos/jneen/parsimmon/pulls/262/comments"},"review_comment":{"href":"https://api.github.com/repos/jneen/parsimmon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jneen/parsimmon/pulls/262/commits"},"statuses":{"href":"https://api.github.com/repos/jneen/parsimmon/statuses/dae1df339f54686915eaf06adee4ada96b395ac8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"wavebeem"}}