🧪
pai Testing
testing
Unit testing framework. Organize tests in suites, use assertion helpers, and get a pass/fail summary.
Install ppm install testing
Usage Example
uses testing; BeginSuite('Math Utils Tests'); It('Clamp should constrain values', procedure begin Expect(Clamp(5, 0, 10) = 5, 'normal value'); Expect(Clamp(-1, 0, 10) = 0, 'below min'); Expect(Clamp(11, 0, 10) = 10, 'above max'); end); It('Mean of [1,2,3] should be 2.0', procedure begin ExpectEqual(FloatToStr(Mean([1.0, 2.0, 3.0])), '2', 'mean'); end); Summary; // prints: 2 passed, 0 failed
Features
Suite and test case organization
Exception-based test failures
Expect(), ExpectEqual(), ExpectNotNil()
Pass/fail count summary report
Works with any PascalAI unit
← Back to Package Index