Removed Chinese support (messed with root). Fixed tests.
This commit is contained in:
@@ -528,11 +528,11 @@ public class MTMathAtomFactory {
|
||||
case "\u{0410}"..."\u{044F}":
|
||||
return MTMathAtom(type: .ordinary, value: chStr)
|
||||
case _ where ch.utf32Char < 0x0021 || ch.utf32Char > 0x007E:
|
||||
// allow Chinese characters for testing
|
||||
if ((ch.utf32Char >= 0x4E00) && (ch.utf32Char <= 0x9FFF)) {
|
||||
// CJK support. But xits-math-cn font only has Chinese characters support.
|
||||
return MTMathAtom(type:.ordinary, value:chStr)
|
||||
}
|
||||
// // allow Chinese characters for testing
|
||||
// if ((ch.utf32Char >= 0x4E00) && (ch.utf32Char <= 0x9FFF)) {
|
||||
// // CJK support. But xits-math-cn font only has Chinese characters support.
|
||||
// return MTMathAtom(type:.ordinary, value:chStr)
|
||||
// }
|
||||
return nil
|
||||
case "$", "%", "#", "&", "~", "\'", "^", "_", "{", "}", "\\":
|
||||
return nil
|
||||
|
||||
@@ -29,9 +29,9 @@ final class ConcurrencyThreadsafeTests: XCTestCase {
|
||||
XCTAssertNotNil(result4)
|
||||
}
|
||||
}
|
||||
executionGroup.notify(queue: .main) { [weak self] in
|
||||
// print("All test cases completed: \(self?.testCount ?? 0)")
|
||||
}
|
||||
// executionGroup.notify(queue: .main) { [weak self] in
|
||||
// // print("All test cases completed: \(self?.testCount ?? 0)")
|
||||
// }
|
||||
executionGroup.wait()
|
||||
}
|
||||
func helperConcurrency(_ count: Int, in group: DispatchGroup, on queue: DispatchQueue, _ testClosure: @escaping () -> (Void)) {
|
||||
|
||||
@@ -47,14 +47,14 @@ final class MTFontMathTableV2Tests: XCTestCase {
|
||||
func helperConcurrentMTFontMathTableV2(_ count: Int, mtfont: MTFontV2, in group: DispatchGroup, on queue: DispatchQueue) {
|
||||
let workitem = DispatchWorkItem {
|
||||
let mTable = mtfont.mathTable
|
||||
let values = [
|
||||
mTable?.fractionNumeratorDisplayStyleShiftUp,
|
||||
mTable?.fractionNumeratorShiftUp,
|
||||
mTable?.fractionDenominatorDisplayStyleShiftDown,
|
||||
mTable?.fractionDenominatorShiftDown,
|
||||
mTable?.fractionNumeratorDisplayStyleGapMin,
|
||||
mTable?.fractionNumeratorGapMin,
|
||||
].compactMap{$0}
|
||||
// let values = [
|
||||
// mTable?.fractionNumeratorDisplayStyleShiftUp,
|
||||
// mTable?.fractionNumeratorShiftUp,
|
||||
// mTable?.fractionDenominatorDisplayStyleShiftDown,
|
||||
// mTable?.fractionDenominatorShiftDown,
|
||||
// mTable?.fractionNumeratorDisplayStyleGapMin,
|
||||
// mTable?.fractionNumeratorGapMin,
|
||||
// ].compactMap{$0}
|
||||
// if count % 50 == 0 {
|
||||
// print(values) // accessed these values on global thread.
|
||||
// }
|
||||
@@ -64,14 +64,14 @@ final class MTFontMathTableV2Tests: XCTestCase {
|
||||
// print("\(Thread.isMainThread ? "main" : "global") completed .....")
|
||||
let mTable = mtfont.mathTable
|
||||
if count % 70 == 0 {
|
||||
let values = [
|
||||
mTable?.fractionNumeratorDisplayStyleShiftUp,
|
||||
mTable?.fractionNumeratorShiftUp,
|
||||
mTable?.fractionDenominatorDisplayStyleShiftDown,
|
||||
mTable?.fractionDenominatorShiftDown,
|
||||
mTable?.fractionNumeratorDisplayStyleGapMin,
|
||||
mTable?.fractionNumeratorGapMin,
|
||||
].compactMap{$0}
|
||||
// let values = [
|
||||
// mTable?.fractionNumeratorDisplayStyleShiftUp,
|
||||
// mTable?.fractionNumeratorShiftUp,
|
||||
// mTable?.fractionDenominatorDisplayStyleShiftDown,
|
||||
// mTable?.fractionDenominatorShiftDown,
|
||||
// mTable?.fractionNumeratorDisplayStyleGapMin,
|
||||
// mTable?.fractionNumeratorGapMin,
|
||||
// ].compactMap{$0}
|
||||
// if count % 50 == 0 {
|
||||
// print(values)
|
||||
// }
|
||||
|
||||
@@ -40,7 +40,7 @@ final class MathImageTests: XCTestCase {
|
||||
XCTAssertNotNil(result.image)
|
||||
if result.error == nil, let image = result.image, let imageData = image.pngData() {
|
||||
safeImage(fileName: "\(caseNumber)", pngData: imageData)
|
||||
let fileUrl = URL(fileURLWithPath: NSTemporaryDirectory())
|
||||
//let fileUrl = URL(fileURLWithPath: NSTemporaryDirectory())
|
||||
print("completed image-\(caseNumber).png")
|
||||
}
|
||||
default:
|
||||
@@ -49,7 +49,7 @@ final class MathImageTests: XCTestCase {
|
||||
XCTAssertNotNil(result.image)
|
||||
if result.error == nil, let image = result.image, let imageData = image.pngData() {
|
||||
safeImage(fileName: "\(caseNumber)", pngData: imageData)
|
||||
let fileUrl = URL(fileURLWithPath: NSTemporaryDirectory())
|
||||
//let fileUrl = URL(fileURLWithPath: NSTemporaryDirectory())
|
||||
print("completed image-\(caseNumber).png")
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ final class MathImageTests: XCTestCase {
|
||||
}
|
||||
executionGroup.notify(queue: .main) { [weak self] in
|
||||
let fileUrl = URL(fileURLWithPath: NSTemporaryDirectory())
|
||||
print("\(self?.testCount)/\(self?.totalCases) completed, check \(fileUrl.path) ===")
|
||||
print("\(self!.testCount)/\(self!.totalCases) completed, check \(fileUrl.path) ===")
|
||||
XCTAssertEqual(self?.testCount,self?.totalCases)
|
||||
}
|
||||
executionGroup.wait()
|
||||
|
||||
Reference in New Issue
Block a user