Created
May 25, 2020 13:24
-
-
Save eastari/2776b18ecd97d5761a6003c2eb66bcbe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
let searchTerm = "Lorem" | |
let targetString = "Lorem Ipsum is ... 😀" | |
let expectedResult = "L̲o̲r̲e̲m̲ Ipsum is ... 😀" | |
let attributedString = NSMutableAttributedString.generateAttributedString(with: searchTerm, targetString: targetString) | |
// Convert attributed string to Unicode text. | |
let mockUnderlineUnicodeText = generateUnderlineUnicodeText(from: attributedString!, by: NSAttributedString.Key.font) | |
// Test | |
XCTAssert(mockUnderlineUnicodeText == expectedResult) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment