     let regex = content()
     for (input, maybeExpectedCaptures) in tests {
       let maybeMatch = input.wholeMatch(of: regex)
-      if let expectedCaptures = maybeExpectedCaptures,
-        let match = maybeMatch
-      {
-        if xfail {
-          XCTFail("Unexpectedly matched", file: file, line: line)
-          continue
-        }
-        XCTAssertTrue(
-          type(of: regex).RegexOutput.self == MatchType.self,
-          """
-          Expected match type: \(MatchType.self)
-          Actual match type: \(type(of: regex).RegexOutput.self)
-          """)
-        let captures = try XCTUnwrap(match.output as? MatchType, file: file, line: line)
-        XCTAssertTrue(
-          equivalence(captures, expectedCaptures),
-          "'\(captures)' is not equal to the expected '\(expectedCaptures)'.",
-          file: file, line: line)
-      } else {
+      guard let match = maybeMatch else {
+        if !xfail, maybeExpectedCaptures != nil {
+          XCTFail("Failed to match '\(input)'", file: file, line: line)
+        }
+        continue
+      }
+      guard let expectedCaptures = maybeExpectedCaptures else {
         if !xfail {
-          XCTAssertNil(maybeMatch, file: file, line: line)
-        }
-      }
+          XCTFail(
+            "Unexpectedly matched '\(match)' for '\(input)'",
+            file: file, line: line)
+        }
+        continue
+      }
+      if xfail {
+        XCTFail("Unexpectedly matched", file: file, line: line)
+        continue
+      }
+      XCTAssertTrue(
+        type(of: regex).RegexOutput.self == MatchType.self,
+        """
+        Expected match type: \(MatchType.self)
+        Actual match type: \(type(of: regex).RegexOutput.self)
+        """)
+      let captures = try XCTUnwrap(match.output as? MatchType, file: file, line: line)
+      XCTAssertTrue(
+        equivalence(captures, expectedCaptures),
+        "'\(captures)' is not equal to the expected '\(expectedCaptures)'.",
+        file: file, line: line)
     }
   }
 

        OneOrMore(.any, .reluctant)
        "stop"
      }
    
    try _testDSLCaptures(
      ("can't stop won't stop", ("can't stop won't stop", "can", "won")),
      matchType: (Substring, Substring, Substring).self, ==) {
        Capture {
          OneOrMore(.word)
          Anchor.wordBoundary

        }
        .ignoresCase(false)
      }

    // FIXME: Re-enable this test
    try _testDSLCaptures(
      ("can't stop won't stop", ("can't stop won't stop", "can't", "won't")),
      matchType: (Substring, Substring, Substring).self, ==, xfail: true) {
        Capture {
          OneOrMore(.word)
          Anchor.wordBoundary
