Bulk Tests
Open the window via Tools > Infinite Value > Bulk Tests. It runs randomized tests across casting, parsing, formatting, arithmetic, and MathInfVal methods, comparing InfVal results against their primitive-type equivalents to catch correctness regressions.
A primitive floating point type rounds where InfVal stays exact, so float,
double, and decimal results can differ from InfVal ones without either
being wrong. In the Arithmetic and Functions modes, Ignore System Type Limits
counts such a result as passed and reports how many there were. A result passes when the two
agree within the significant digits the type guarantees (6 for float, 15 for
double, 28 for decimal), widened by how far the result can move while
each primitive input stays within its own guaranteed digits. Any failure left points at InfVal.
Unit tests
A NUnit test suite is included and runs via Unity's built-in Test Runner (Window > General > Test Runner, Edit Mode tab). The suite covers:
- InfValPropertiesTests:
precision,isZero,isOne,isInteger,isEven,isPowerOfTwo,sign,digits,exponent. - InfValComparisonTests: All six comparison operators and
CompareTo. - InfValArithmeticTests: Every arithmetic, bitwise, and shift operator.
- InfValMethodsTests:
ToPrecision,ToExponent,RemoveTrailingZeros,MovePointLeft/Right,Deconstruct. - InfValCastTests: Round-trip casts for all integer types,
BigInteger,float, anddouble. - InfValParseTests:
InfValFormatHelper.TryParsewith known strings. - FormatterTests: Formatting output for all built-in formatters.
- MathInfValTests: Most
MathInfValmethods.
Run both tools after modifying any scripts to catch regressions.