Another test, remove print statements

This commit is contained in:
Shadowfacts 2024-05-22 18:59:24 -04:00
parent 5fbf806e73
commit a93a53e8d3
2 changed files with 10 additions and 8 deletions

View File

@ -19,11 +19,7 @@ import Foundation
*/ */
struct BlockStateMachine { struct BlockStateMachine {
var blockState: BlockState = .start { var blockState: BlockState = .start
didSet {
print("new state: \(blockState)")
}
}
let blockBreak: String let blockBreak: String
let lineBreak: String let lineBreak: String
let listIndentForContentOutsideItem: String let listIndentForContentOutsideItem: String
@ -34,7 +30,6 @@ struct BlockStateMachine {
extension BlockStateMachine { extension BlockStateMachine {
mutating func startOrEndBlock() { mutating func startOrEndBlock() {
print("start/end block")
switch blockState { switch blockState {
case .start: case .start:
break break
@ -83,7 +78,6 @@ extension BlockStateMachine {
} }
mutating func continueBlock(char: UnicodeScalar) -> Bool { mutating func continueBlock(char: UnicodeScalar) -> Bool {
print("continue block: \(char.debugDescription)")
let isNewline = char == "\n" let isNewline = char == "\n"
let isWhitespace = isNewline || isWhitespace(char) let isWhitespace = isNewline || isWhitespace(char)
switch blockState { switch blockState {
@ -298,7 +292,6 @@ extension BlockStateMachine {
} }
mutating func breakTag() { mutating func breakTag() {
print("break tag")
switch blockState { switch blockState {
case .start: case .start:
break break

View File

@ -561,6 +561,15 @@ final class AttributedStringConverterTests: XCTestCase {
XCTAssertEqual(convert("<ol><li><p>a</p></li><li><p>b</p></li></ol>"), result) XCTAssertEqual(convert("<ol><li><p>a</p></li><li><p>b</p></li></ol>"), result)
} }
func testMultipleParagraphsInsideListItem() {
let result = NSAttributedString(string: "\t1.\ta\n\nb", attributes: [
.font: font,
.paragraphStyle: listParagraphStyle,
.foregroundColor: color,
])
XCTAssertEqual(convert("<ol><li><p>a</p><p>b</p></li></ol>"), result)
}
func testBreakBetweenListItems() { func testBreakBetweenListItems() {
let result = NSAttributedString(string: "\t1.\ta\n\n\t2.\tb", attributes: [ let result = NSAttributedString(string: "\t1.\ta\n\n\t2.\tb", attributes: [
.font: font, .font: font,