Hello, Attached is a slightly improved patch - minor code changes, and many more tests. Line coverage is 98%, and branch coverage is now >93% , and most of the non-covered branches are simply unreachable (I'm checking the reachable ones).
The comments below still apply. - gordon Assaf Gordon wrote, On 12/13/2012 01:02 AM: > > Most of the previously raised issues have been addressed, except handling > locale'd grouping in the input numbers (locale'd decimal-point is handled > correctly). > > Added support for header, auto-whitespace-padding, floating-point input . > Internally, all values are now stored as "long double" (instead of previously > uintmax_t) - enables working with Yotta-scale values. > > The following should now 'just work' : > df | ./src/numfmt --header --field 2 --to=si > ls -l | ./src/numfmt --header --field 5 --to=iec > ls -lh | ./src/numfmt --header --field 5 --from=iec --padding=10 > > The "--debug" option now behaves more like sort's "--debug": prints messages > to STDERR about possible bad combinations and inputs (which are not fatal > errors): > > $./src/numfmt --debug 60000 > ./src/numfmt: no conversion option specified > 60000 > > The "--devdebug" option can be used to show internal states (perhaps will be > removed once the program is finalized?). > > The test file 'tests/misc/numfmt.pl' contains many more tests and details > about possible inputs/outputs. > > If the functionality is acceptable, the next steps are cleaner code and > better documentations. >
numfmt.8.patch.xz
Description: application/xz