- Convert XCTestCase classes to structs with @Test functions - Replace XCTAssert* with #expect, and force unwraps/XCTFail with #require - Resolve test bundle via a class token in the CLI smoke test (Swift Testing does not register the .xctest bundle in Bundle.allBundles) - Rename adaptForXCTest() to adaptForTest()
20 lines
395 B
Swift
20 lines
395 B
Swift
//
|
|
// StringExtensions.swift
|
|
//
|
|
//
|
|
// Created by Thibaut Schmitt on 05/09/2022.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension String {
|
|
|
|
/// Remove all new lines and leading/trailing whitespaces
|
|
func adaptForTest() -> Self {
|
|
self
|
|
.split(separator: "\n")
|
|
.compactMap { String($0).removeLeadingTrailingWhitespace() }
|
|
.joined(separator: " - ")
|
|
}
|
|
}
|