Skip to content

Commit

Permalink
Fixed to support macOS 10.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tid-kijyun committed Aug 7, 2021
1 parent 2bc5850 commit 4553c7f
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions Tests/KannaTests/KannaCSSTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,23 @@ class KannaCSSTests: XCTestCase {
let allCheckCount = 100 * css2xpath.count
(0..<100).forEach { _ in
for testCase in css2xpath {
DispatchQueue.global().async {
do {
let xpath = try CSS.toXPath(testCase.css)
XCTAssert(xpath == testCase.xpath, "Create XPath = [\(xpath)] != [\(testCase.xpath)]")
} catch {
XCTAssert(false, error.localizedDescription)
if #available(macOS 10.10, *) {
DispatchQueue.global().async {
do {
let xpath = try CSS.toXPath(testCase.css)
XCTAssert(xpath == testCase.xpath, "Create XPath = [\(xpath)] != [\(testCase.xpath)]")
} catch {
XCTAssert(false, error.localizedDescription)
}
lock.lock()
checkedCount += 1
if checkedCount == allCheckCount {
exp.fulfill()
}
lock.unlock()
}
lock.lock()
checkedCount += 1
if checkedCount == allCheckCount {
exp.fulfill()
}
lock.unlock()
} else {
// Fallback on earlier versions
}
}
}
Expand Down

0 comments on commit 4553c7f

Please sign in to comment.