Parent: #114
Summary
Add self-contained matchers to TGocciaExpectationValue in Goccia.Builtins.TestAssertions.pas that require no new infrastructure.
Matchers
Implementation notes
- All matchers follow the existing pattern: method on
TGocciaExpectationValue, respects FIsNegated, calls AssertionFailed() on mismatch
toStrictEqual differs from toEqual by checking constructor identity and not allowing type coercion
toMatchObject recursively checks that every key in the expected object exists in the actual with matching values (subset check)
- Tests should run in both TestRunner and Vitest
Parent: #114
Summary
Add self-contained matchers to
TGocciaExpectationValueinGoccia.Builtins.TestAssertions.pasthat require no new infrastructure.Matchers
toMatch(string)— string-only initially (regex variant deferred to Add regular expression support (RegExp constructor and /pattern/flags literals) #115)toContainEqual(value)— deep equality check within arrays (uses existingDeepEquallogic)toStrictEqual(value)— strict deep equality with class instance awarenesstoMatchObject(obj)— partial/subset object matchingImplementation notes
TGocciaExpectationValue, respectsFIsNegated, callsAssertionFailed()on mismatchtoStrictEqualdiffers fromtoEqualby checking constructor identity and not allowing type coerciontoMatchObjectrecursively checks that every key in the expected object exists in the actual with matching values (subset check)