[Toybox] [PATCH] (gzipped patch due to size) Remove large amount of auto-generated test cases for bc

Oliver Webb aquahobbyist at proton.me
Thu Feb 29 22:37:13 PST 2024


Heya, Was trying to not bother the list on Feb 29th because 0.9 (0.8.11?) was supposed to come out,
And I didn't wanna delay it with things like bc cleanup.

That being said, I was looking at the test suite for bc and...

Almost all of the cases are in tests/files/bc, which is over 400k in size
(Comparable to the _entirety_ of toys/posix, we implement find and sed and a dozen other things
in the size it takes to test one command). And contains:

$ find tests/files/bc -name "*.txt" | grep -v res | xargs wc -l | tail -n1
 23312 total

23,000 test cases, looking at them, most of them are auto-generated, and test things
over and over again through a set of about a dozen numbers. parse.txt tests about 1000 things
for every base. To make sure that everything is correct, the same way
that _truly_ testing a numerical function requires looping through all the numbers and making
sure every answer is right, because what would we do if giving 5616512331131.865 fails and _nothing_ else?

arctan.txt can be automated by a for loop in bc, and so can most of these, but would probably
have to do the for loops in bash to get text processing stuff.

parse.txt is still way to large, but less ridiculous, I removed the test cases for everything
except base 2, 3, 8, and 16. I'd be very interested in any serious use of bases 5, 6, 7, 9, 11, 13, or 14
anywhere by anything at any time that isn't stuff explicitly about weird bases. And if one of those fails, it's likely
that base 2 or 3 or something will also fail.

This patch removes a lot of stuff, and is therefore way too large to get through the spam filter in it's plain form.
Since if It gets caught in it no one on the list can see it besides rob. I've compressed the patch with gzip -9.
(Only people that can decompress the patch seeing it is better then _noone_ being able to unless it gets applied).
I've never delt with a patch this large, and it cant be broken up easily (parse.txt cleanup is 90% of it), so this seemed
like the best solution. The patch is about 180k uncompressed

-   Oliver Webb <aquahobbyist at proton.me>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-bc-remove-a-ton-of-auto-generated-test-cases-that-ar.patch.gz
Type: application/gzip
Size: 38614 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20240301/8f1c4000/attachment-0001.gz>


More information about the Toybox mailing list