<!--
{
  "availability" : [
    "Xcode: 16.0.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "swift: 6.0.0 -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/Test(_:_:arguments:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "s:7Testing4Test__9arguments_ySSSgYt_AA0B5Trait_pdxq_tcSlRzs8SendableRzSlR_sAFR_sAF7ElementRpzsAfGRp_r0_lufm"
  },
  "title" : "Test(_:_:arguments:_:)"
}
-->

# Test(_:_:arguments:_:)

Declare a test parameterized over two collections of values.

```
@attached(peer) macro Test<C1, C2>(_ displayName: String? = nil, _ traits: any TestTrait..., arguments collection1: C1, _ collection2: C2) where C1 : Collection, C1 : Sendable, C2 : Collection, C2 : Sendable, C1.Element : Sendable, C2.Element : Sendable
```

## Parameters

`displayName`

The customized display name of this test. If the value of
this argument is `nil`, the display name of the test is derived from the
associated function’s name.

`traits`

Zero or more traits to apply to this test.

`collection1`

A collection of values to pass to `testFunction`.

`collection2`

A second collection of values to pass to `testFunction`.

## Overview

You can prefix the expressions you pass to `collection1` or `collection2`
with `try` or `await`. The testing library evaluates the expressions lazily
only if it determines that the associated test will run. During testing, the
testing library calls the associated test function once for each pair of
elements in `collection1` and `collection2`.

## See Also

[Defining test functions](/documentation/Testing/DefiningTests)

Define a test function to validate that code is working correctly.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)