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 for negative feet/inch parsing #674

Merged
merged 3 commits into from
Jul 9, 2019

Conversation

tmilnthorp
Copy link
Collaborator

Fix for #673.

@angularsen
Copy link
Owner

Looks good to me, only a failing test case.

@tmilnthorp
Copy link
Collaborator Author

Looks good to me, only a failing test case.

Oops. I put "- 1′ 1″ " when I meant " -1′ 1″ ". Multi-line added the negative sign :) Fixed

That said, should "- 1′ 1″ "work?

@angularsen
Copy link
Owner

I don't know, but my intuition tells me we shouldn't have to support something like that. We have been bit previously by trying to be too lenient in parsing all sorts of input.

[InlineData( "-1 ft 1 in", -1.08333333 )]
[InlineData( "-1ft 1in", -1.08333333 )]
[InlineData("-1'", 1)] // Feet only
[InlineData("-1′", 1)] // Feet only
Copy link
Owner

Choose a reason for hiding this comment

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

Wait, what? Shouldn't expectedFeet still be negative 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Haha I re-copied-and-pasted. It's been a long day :) fixed

@angularsen
Copy link
Owner

Looks good now :-) green tests too!

@angularsen angularsen merged commit 3ebfbe6 into angularsen:master Jul 9, 2019
@angularsen
Copy link
Owner

Would you publish a new release too, please?

@tmilnthorp
Copy link
Collaborator Author

Will do

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