Publish v1.0
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Reviewed-on: #1
This commit is contained in:
19
Tests/ResgenSwiftTests/Extensions/StringExtensions.swift
Normal file
19
Tests/ResgenSwiftTests/Extensions/StringExtensions.swift
Normal file
@ -0,0 +1,19 @@
|
||||
//
|
||||
// StringExtensions.swift
|
||||
//
|
||||
//
|
||||
// Created by Thibaut Schmitt on 05/09/2022.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension String {
|
||||
|
||||
/// Remove all new lines and leading/trailing whitespaces
|
||||
func adaptForXCTest() -> Self {
|
||||
self
|
||||
.split(separator: "\n")
|
||||
.compactMap { String($0).removeLeadingTrailingWhitespace() }
|
||||
.joined(separator: " - ")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user