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

Fix error formatting bug #262

Merged
merged 3 commits into from
Jun 26, 2018
Merged

Conversation

halfzebra
Copy link
Contributor

Addresses a bug discovered by @wavebeem in issue #239

Introduces tests and minor refactoring.

@@ -481,15 +480,23 @@ function formatGot(input, error) {
column = columnByteIndex * 3;

// Account for an extra space.
if (columnByteIndex > 4) {
if (columnByteIndex >= 4) {
Copy link
Contributor Author

@halfzebra halfzebra Jun 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the error occurred.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha! i've been there before 😄

@@ -481,15 +480,23 @@ function formatGot(input, error) {
column = columnByteIndex * 3;

// Account for an extra space.
if (columnByteIndex > 4) {
if (columnByteIndex >= 4) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha! i've been there before 😄

var answer = Parsimmon.formatError(input, parser.parse(input));

assert.deepEqual(answer, expectation);
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the thorough tests!!

@coveralls
Copy link

coveralls commented Jun 25, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling dae1df3 on halfzebra:fix-error-formatting into 5a5dbc2 on jneen:master.

@wavebeem wavebeem merged commit 8fb4ec1 into jneen:master Jun 26, 2018
@wavebeem
Copy link
Collaborator

Thanks! Released as v1.11.1

@halfzebra halfzebra deleted the fix-error-formatting branch June 26, 2018 06:51
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.

3 participants