Skip to content

Commit

Permalink
Do not use Regex in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pzmudzinski committed Dec 26, 2023
1 parent 23619db commit 0adf197
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

## Overview

This Swift package is an API wrapper for the remove.bg API. It simplifies the integration of remove.bg's functionality into Swift-based projects, providing an easy and efficient way to access and utilize the API's capabilities.
This Swift package is an API wrapper for the [remove.bg](https://remove.bg) API.
It simplifies the integration of remove.bg's functionality into Swift-based projects, providing an easy and efficient way to access and utilize the API's capabilities.

## Features

Expand Down
2 changes: 1 addition & 1 deletion Tests/RemoveBgTests/Mocks/MockURLProtocol+XCTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func XCTAssertHeader(key: String, value: String, file: StaticString = #filePath,
XCTAssertEqual(value, lastRequest.allHTTPHeaderFields?[key], file: file, line: line)
}

func XCTAssertHeader(key: String, value: Regex<AnyRegexOutput>, file: StaticString = #filePath, line: UInt = #line) {
func XCTAssertHeader(key: String, value: Regex<Substring>, file: StaticString = #filePath, line: UInt = #line) {
guard let lastRequest = MockURLProtocol.lastRequest else {
XCTFail("No URLRequest recorded", file: file, line: line)
return
Expand Down
2 changes: 1 addition & 1 deletion Tests/RemoveBgTests/RemoveBgTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class RemoveBgParametersTests: XCTestCase {

func testContentType() async throws {
let _ = try await client.removeBackground(fromFileAtUrl: .sampleImage)
let regex = try Regex("^multipart/form-data; boundary=.+$")
let regex = #/^multipart/form-data; boundary=.+$/#
XCTAssertHeader(key: "Content-Type", value: regex)
}

Expand Down

0 comments on commit 0adf197

Please sign in to comment.