verifyLength function
Verify that a list has a specific length.
Example:
verifyLength(items, 3, 'Should have exactly 3 items');
Returns true if the verification passed, false otherwise.
Implementation
bool verifyLength(List list, int length, [String? message]) {
if (list.length != length) {
final msg = message ?? 'Expected length $length but got ${list.length}';
_verificationFailures.add(msg);
return false;
}
return true;
}