summaryrefslogtreecommitdiff
path: root/factors/table_test.go
AgeCommit message (Collapse)Author
2023-11-12Add per-file copyright notices & contact infoAdrien Hopkins
This is the safest thing to do to ensure my software is free while avoiding legal trouble ... hopefully, I'm not a lawyer!
2023-11-09Reduce golang requirement to go1.18Adrien Hopkins
go1.21, the previous requirement, was released a few months ago, so not all systems have adopted it. go1.18 is old enough that most systems should support it, but it introduces generics, which my testing code is highly dependent on, so I can't easily go any earlier.
2023-10-09factors: Give Type proper name & zero valueAdrien Hopkins
2023-10-09Add tests for properties of many outputsAdrien Hopkins
- Test that every number returned by factors.Factors is actually a factor of its argument. - Test that every number returned by factors.TotativeDigits is actually a totative of its argument, and that len(factors.TotativeDigits(r)) == factors.Totient(r). - Test the properties of factors.Split (regular * totative == digit, totative is a totative of radix). Some of these tests don't test every number in the range, instead picking randomly, which is done in order to avoid tests taking too long to execute. Some testing is better than no testing!