code cleaning: remove print statement

This commit is contained in:
Nicolas Guillot
2025-11-18 09:01:00 +01:00
parent 90767b7953
commit 8ce6da114c
7 changed files with 1 additions and 46 deletions

View File

@@ -285,7 +285,7 @@ public class MTMathAtom: NSObject {
assert(self.superScript == nil, "Cannot fuse into an atom which has a superscript: \(self)");
assert(atom.type == self.type, "Only atoms of the same type can be fused. \(self), \(atom)");
guard self.subScript == nil, self.superScript == nil, self.type == atom.type
else { print("Can't fuse these 2 atoms"); return }
else { return }
// Update the fused atoms list
if self.fusedAtoms.isEmpty {

View File

@@ -22,7 +22,6 @@ final class MTFontMathTableV2Tests: XCTestCase {
mTable?.fractionNumeratorDisplayStyleGapMin,
mTable?.fractionNumeratorGapMin,
].compactMap{$0}
print("\($0.rawValue).plist: \(values)")
}
}
private let executionQueue = DispatchQueue(label: "com.swiftmath.mathbundle", attributes: .concurrent)
@@ -40,7 +39,6 @@ final class MTFontMathTableV2Tests: XCTestCase {
executionGroup.notify(queue: .main) { [weak self] in
guard let self = self else { return }
XCTAssertEqual(self.testCount, totalCases)
print("\(self.testCount) completed =================")
}
executionGroup.wait()
}

View File

@@ -31,7 +31,6 @@ final class MTFontV2Tests: XCTestCase {
executionGroup.notify(queue: .main) { [weak self] in
guard let self = self else { return }
XCTAssertEqual(self.testCount, totalCases)
print("\(self.testCount) completed =================")
}
executionGroup.wait()
}
@@ -68,7 +67,6 @@ final class MTFontV2Tests: XCTestCase {
executionGroup.notify(queue: .main) { [weak self] in
guard let self = self else { return }
XCTAssertEqual(self.testCount, totalCases)
print("\(self.testCount) completed =================")
}
executionGroup.wait()
}

View File

@@ -2187,19 +2187,9 @@ final class MTMathListBuilderTests: XCTestCase {
]
for (latex, desc) in testCases {
print("Testing: \(desc)")
print(" LaTeX: \(latex)")
var error: NSError? = nil
let list = MTMathListBuilder.build(fromString: latex, error: &error)
if let err = error {
print(" ERROR: \(err.localizedDescription)")
} else if list == nil {
print(" List is nil but no error")
} else {
print(" SUCCESS: Got \(list!.atoms.count) atoms")
}
let unwrappedList = try XCTUnwrap(list, "Should parse: \(desc)")
XCTAssertNil(error, "Should not error on \(desc): \(error?.localizedDescription ?? "")")
XCTAssertTrue(unwrappedList.atoms.count >= 1, "\(desc) should have atoms")
@@ -2474,19 +2464,9 @@ final class MTMathListBuilderTests: XCTestCase {
]
for (latex, desc) in testCases {
print("Testing: \(desc)")
print(" LaTeX: \(latex)")
var error: NSError? = nil
let list = MTMathListBuilder.build(fromString: latex, error: &error)
if let err = error {
print(" ERROR: \(err.localizedDescription)")
} else if list == nil {
print(" List is nil but no error")
} else {
print(" SUCCESS: Got \(list!.atoms.count) atoms")
}
let unwrappedList = try XCTUnwrap(list, "Should parse: \(desc)")
XCTAssertNil(error, "Should not error on \(desc): \(error?.localizedDescription ?? "")")
XCTAssertTrue(unwrappedList.atoms.count >= 1, "\(desc) should have atoms")
@@ -2521,19 +2501,9 @@ final class MTMathListBuilderTests: XCTestCase {
]
for (latex, desc) in testCases {
print("Testing: \(desc)")
print(" LaTeX: \(latex)")
var error: NSError? = nil
let list = MTMathListBuilder.build(fromString: latex, error: &error)
if let err = error {
print(" ERROR: \(err.localizedDescription)")
} else if list == nil {
print(" List is nil but no error")
} else {
print(" SUCCESS: Got \(list!.atoms.count) atoms")
}
let unwrappedList = try XCTUnwrap(list, "Should parse: \(desc)")
XCTAssertNil(error, "Should not error on \(desc): \(error?.localizedDescription ?? "")")
XCTAssertTrue(unwrappedList.atoms.count >= 1, "\(desc) should have atoms")

View File

@@ -253,7 +253,6 @@ class MTMathUILabelLineWrappingTests: XCTestCase {
// Check that we have multiple display elements (wrapped content)
if let displayList = label.displayList {
print("Display has \(displayList.subDisplays.count) subdisplays")
XCTAssertGreaterThan(displayList.subDisplays.count, 1, "Should have multiple display elements from wrapping")
}
}

View File

@@ -76,7 +76,6 @@ final class MathFontTests: XCTestCase {
executionGroup.notify(queue: .main) { [weak self] in
guard let self = self else { return }
XCTAssertEqual(self.testCount, totalCases)
print("\(self.testCount) completed =================")
}
executionGroup.wait()
}

View File

@@ -24,8 +24,6 @@ final class MathImageTests: XCTestCase {
XCTAssertNotNil(result.layoutInfo)
if result.error == nil, let image = result.image, let imageData = image.pngData() {
safeImage(fileName: "test", pngData: imageData)
let fileUrl = URL(fileURLWithPath: NSTemporaryDirectory())
print("completed, check \(fileUrl.path) image-test.png =================")
}
}
func testSequentialMultipleImageScript() throws {
@@ -42,8 +40,6 @@ final class MathImageTests: XCTestCase {
XCTAssertNotNil(result.layoutInfo)
if result.error == nil, let image = result.image, let imageData = image.pngData() {
safeImage(fileName: "\(caseNumber)", pngData: imageData)
//let fileUrl = URL(fileURLWithPath: NSTemporaryDirectory())
print("completed image-\(caseNumber).png")
}
default:
result = SwiftMathImageResult.useMTMathImage(latex: latex, font: mathfont, fontSize: fontsize)
@@ -51,12 +47,9 @@ 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())
print("completed image-\(caseNumber).png")
}
}
}
print("check: \(URL(fileURLWithPath: NSTemporaryDirectory()).path) ==")
}
private let executionQueue = DispatchQueue(label: "com.swiftmath.mathbundle", attributes: .concurrent)
@@ -78,8 +71,6 @@ 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) ===")
XCTAssertEqual(self?.testCount,self?.totalCases)
}
executionGroup.wait()