-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Fixes spaces in fractions causing invalid output (#435) #436
Conversation
Codecov Report
@@ Coverage Diff @@
## master #436 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 20 20
Lines 742 758 +16
=====================================
+ Hits 742 758 +16
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fantastic! Thanks!
* @param {string} str | ||
* @returns {string} | ||
*/ | ||
const glueFractionMembers = function glueFractionMembers(str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the JSDoc! Thanks!
@@ -23,6 +23,16 @@ describe('lost-center', function() { | |||
); | |||
}); | |||
|
|||
it('generates valid output given spaces are present in the input', function() { | |||
check( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
@@ -3,6 +3,14 @@ | |||
var expect = require('chai').expect; | |||
var utils = require('../lib/_lu-utilities.js'); | |||
|
|||
describe('glueFractionMembers', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
What kind of change is this? (Bug Fix, Feature...)
Bug Fix of #435
Does this introduce any breaking changes?
No
Does the PR fulfill these requirements?
Other Comments
Hi @peterramsing ,
I fixed the bug in #435 , that was actually present in every lost declaration which syntax allows fractions. I fixed it with the smallest possible code change, but maybe working on a proper parser would avoid this whole class of bugs... I'll try to draft a grammar of lost's syntax when I'll be less busy.
I added tests for this bug, but did not update the docs, since this edit is meant to allow input slightly different from ideal, but not wrong in its meaning either.