So I redid fmt.c and think it's ready to promote, but now I'm tweaking it to pass the fmt tests and... making them match what ubuntu's doing exactly is weird?
$ echo -e 'hello world\n this is some text' | fmt -w 10 hello world this is some text $ echo -e 'hello world\n this is some text' | ./fmt -w 10 hello world this is some text Why is ubuntu _not_ producing the second output? If -w means wrap before this column, then space, 4 char word, space, 2 char word is 8 characters which is less than 10. (Heck, it's less than 9.) So why does "this" wind up on its own line on line 3 in ubuntu's version? If you remove the space after the newline they match, but testing fmt without indentation is missing like half the logic? I made the existing tests pass, but I want to add tests to actually test what the new one is doing, like measuring and preserving tab/space mixes in indents. But fmt turns into weird corner case city. I ran the README and main.c through it when developing it, but that's not a stable test I can put in the test suite... Sigh. I can write tests that toybox passes, but a test that simply matches the output of a single implementation doesn't really prove much, does it? Grrr... *shrug* Probably promote it and cut a release this week anyway... Rob _______________________________________________ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net