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

#482: Smoke Testcase for the endless loop because of white-space hand… #483

Merged
merged 5 commits into from
May 18, 2020

Conversation

rototor
Copy link
Contributor

@rototor rototor commented May 15, 2020

…ling.

It demonstrates the bug in #482, a endless loop while trying to break a line. Should be included to detect regressions with that in future.

This is a special case only for this single case: Line-Width is 0 and the
line only contains of a soft-hypen.  In this case we don't need to try to
break on the character level, as this will not work, but will lead to a
endless loop. So we pretend we already did try to break on the character
level. This ends the loop for this line.
@rototor
Copy link
Contributor Author

rototor commented May 18, 2020

This is no longer a smoke test, but also provides a fix for this problem which seems to work and not break any other test.

@syjer
Copy link
Contributor

syjer commented May 18, 2020

hi @rototor , I may be wrong, but I think it will still fail if the string is larger than 1 but contains only SOFT_HYPHEN characters.

I would guess for each input string, we should reduce it to always have only one consecutive SOFT_HYPHEN .

…tter how many

they are.

Also extended the test file. Thanks to @syjer to bring these cases up.
@rototor
Copy link
Contributor Author

rototor commented May 18, 2020

@syjer You are right, I extended the testcase and the fix to also handle that cases.

@danfickle
Copy link
Owner

Thanks both of you. That would have taken me ages to find.

@danfickle danfickle merged commit f82c54b into danfickle:open-dev-v1 May 18, 2020
danfickle added a commit that referenced this pull request May 26, 2020
…phen overflowing line.

The core problem seems to be the under-reporting of width when we have a soft hyphen that is found to be unbreakable.
danfickle added a commit that referenced this pull request Jun 1, 2020
Plus minor behaviour change for word break method to avoid setting ends-on -soft-hyphen flag for soft hyphen at end of box.
danfickle added a commit that referenced this pull request Jun 7, 2020
This is to make sure infinite loop fixes do not break this functionality.
danfickle added a commit that referenced this pull request Jun 7, 2020
…w line.

With test to prove that we don't trigger safety valve with lots of unbreakable words. Safety valve should only be triggered if there is still a bug in our code.
danfickle added a commit that referenced this pull request Jun 9, 2020
This should ensure no infinite loop bugs creep in over time.
danfickle added a commit that referenced this pull request Jun 13, 2020
#482 #483 #491 Make word breaker testable and start writing tests.
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