add iiiint LaTeX command support
This commit is contained in:
@@ -331,6 +331,7 @@ public class MTMathAtomFactory {
|
|||||||
"int" : MTMathAtomFactory.operatorWithName( "\u{222B}", limits: false),
|
"int" : MTMathAtomFactory.operatorWithName( "\u{222B}", limits: false),
|
||||||
"iint" : MTMathAtomFactory.operatorWithName( "\u{222C}", limits: false),
|
"iint" : MTMathAtomFactory.operatorWithName( "\u{222C}", limits: false),
|
||||||
"iiint" : MTMathAtomFactory.operatorWithName( "\u{222D}", limits: false),
|
"iiint" : MTMathAtomFactory.operatorWithName( "\u{222D}", limits: false),
|
||||||
|
"iiiint" : MTMathAtomFactory.operatorWithName( "\u{2A0C}", limits: false),
|
||||||
"oint" : MTMathAtomFactory.operatorWithName( "\u{222E}", limits: false),
|
"oint" : MTMathAtomFactory.operatorWithName( "\u{222E}", limits: false),
|
||||||
"bigwedge" : MTMathAtomFactory.operatorWithName( "\u{22C0}", limits: true),
|
"bigwedge" : MTMathAtomFactory.operatorWithName( "\u{22C0}", limits: true),
|
||||||
"bigvee" : MTMathAtomFactory.operatorWithName( "\u{22C1}", limits: true),
|
"bigvee" : MTMathAtomFactory.operatorWithName( "\u{22C1}", limits: true),
|
||||||
|
|||||||
@@ -2286,12 +2286,25 @@ final class MTMathListBuilderTests: XCTestCase {
|
|||||||
var error: NSError? = nil
|
var error: NSError? = nil
|
||||||
let list = MTMathListBuilder.build(fromString: latex, error: &error)
|
let list = MTMathListBuilder.build(fromString: latex, error: &error)
|
||||||
|
|
||||||
if list == nil || error != nil {
|
if let err = error {
|
||||||
throw XCTSkip("Multiple integral symbols (\\iint, \\iiint) not implemented: \(desc). Error: \(error?.localizedDescription ?? "nil result")")
|
XCTFail("ERROR: \(err.localizedDescription)")
|
||||||
|
} else if list == nil {
|
||||||
|
XCTFail("List is nil but no error")
|
||||||
}
|
}
|
||||||
|
|
||||||
let unwrappedList = try XCTUnwrap(list, "Should parse: \(desc)")
|
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")
|
XCTAssertTrue(unwrappedList.atoms.count >= 1, "\(desc) should have atoms")
|
||||||
|
|
||||||
|
// Verify we have a large operator (integral) in the list
|
||||||
|
var foundOperator = false
|
||||||
|
for atom in unwrappedList.atoms {
|
||||||
|
if atom.type == .largeOperator {
|
||||||
|
foundOperator = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
XCTAssertTrue(foundOperator, "\(desc) should contain a large operator (integral)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user