OcrOrientationTest.swift 15 lignes · 553 octets
import XCTest
@testable import Card2vcf

final class OcrOrientationTest: XCTestCase {
    func testScorePrefereEmailEtTelephone() {
        let weak = OcrResult(rawText: "abc", phones: [], emails: [])
        let strong = OcrResult(
            rawText: "Jean Paul GENOUX\njpgenoux@dimosoftware.com\n+33674640544",
            phones: ["+33674640544"],
            emails: ["jpgenoux@dimosoftware.com"],
            urls: ["https://www.dimosoftware.fr"]
        )
        XCTAssertTrue(OcrOrientation.score(strong) > OcrOrientation.score(weak))
    }
}