---
title: "matches(_:requirement:)"
framework: appintentstesting
role: symbol
role_heading: Type Method
platforms: [iOS 27.3+, iPadOS 27.3+, Mac Catalyst 27.3+, macOS 27.3+, tvOS 27.3+, visionOS 27.3+, watchOS 27.3+]
path: "appintentstesting/intentvalueexpectation/matches(_:requirement:)"
---

# matches(_:requirement:)

Creates an expectation that requires the value to satisfy a predicate, with an optional description of the check.

## Declaration

```swift
static func matches<Input>(_ predicate: Predicate<Input>, requirement: String? = nil) -> PredicateExpectation where Input : IntentValueConvertible
```

## Parameters

- `predicate`: The predicate to evaluate against the value.
- `requirement`: A readable description of the check. The default is nil.

## Return Value

Return Value A predicate expectation that evaluates predicate against the value.

## Discussion

Discussion Use this method for values that aren’t strings. A predicate on a non-optional type isn’t satisfied when the value is missing, and a predicate on an optional type receives nil and decides for itself. A predicate whose input type doesn’t match the value’s type isn’t satisfied.
