consolidation / output-formatters

Apply transformations to structured data to write output in different formats.
Other
192 stars 13 forks source link

Typo in CalculateWidths::distributeLongColumns causes failure for some column width distributions. #56

Closed greg-1-anderson closed 7 years ago

greg-1-anderson commented 7 years ago

Fixes https://github.com/pantheon-systems/terminus/issues/1701.

Overview

This pull request:

Summary

Simple typo in seldom-needed code causes a blow-up.

The untested part of the function iteratively refines the column width distributions only in cases where the first pass doesn't get the best distribution. However, this rarely happens, so this code was not covered by tests. Added a carefully-contrived test to ensure this code is covered by tests.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.4%) to 95.208% when pulling 957c7f94f6d688c60580dab0ffd1b1e014501b1a on fix-wordwrap-typo into 2e09069866bae89d3fb545365f997a40745e34d2 on master.