import Foundation import Testing import ZIPFoundation import LegadoCore @testable import LegadoAppModels @MainActor struct EPUBReadingRegressionTests { private func fixture(at root: URL) throws -> URL { let url = root.appendingPathComponent("示例.epub") let archive = try Archive(url: url, accessMode: .create) let files = [ ("mimetype", "application/epub+zip"), ("META-INF/container.xml", #""#), ("book.opf", #"回归书籍测试作者"#), ("first.xhtml", "第一章

第一章

第一章测试正文

"), ("last.xhtml", "第二章

第二章

第二章测试正文

") ] for (path, value) in files { let data = Data(value.utf8) try archive.addEntry(with: path, type: .file, uncompressedSize: Int64(data.count), compressionMethod: .deflate) { position, size in data.subdata(in: Int(position)..