Improved reading and writing large Office files without copying them into memory (#1243)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-28 23:03:30 +01:00
1 parent 918572c158
commit dbe609a9a7
37 files changed
+1161 -471

No files matched your search

@@ -199,7 +199,7 @@ public sealed class MarkdownSegmentFormatTests
{
var source = await this.WriteSourceAsync("Fish & Chips cost 5 \\* 3 \\| 2 © us.\n");
var keys = (await this.format.ReadAsync(source, CancellationToken.None)).Select(segment => segment.Key).ToList();
var keys = (await this.format.ReadAsync(source, NullLogger.Instance, CancellationToken.None)).Select(segment => segment.Key).ToList();
Assert.That(keys, Is.EqualTo(new[] { "Fish & Chips cost 5 * 3 | 2 © us." }));
}
@@ -277,7 +277,7 @@ public sealed class MarkdownSegmentFormatTests
{
var source = await this.WriteSourceAsync("Press &lt;1&gt; to continue.\n\nPress <1 /> as well.\n\nOther words.\n");
var keys = (await this.format.ReadAsync(source, CancellationToken.None)).Select(segment => segment.Key).ToList();
var keys = (await this.format.ReadAsync(source, NullLogger.Instance, CancellationToken.None)).Select(segment => segment.Key).ToList();
Assert.That(keys, Is.EqualTo(new[] { "Other words." }), "A model could not tell such words apart from tags, even when they come from two entities and the words between them.");
}
@@ -291,7 +291,7 @@ public sealed class MarkdownSegmentFormatTests
private async Task<SegmentResults> ResultsAsync(string path, Func<string, string> transform)
{
var segments = await this.format.ReadAsync(path, CancellationToken.None);
var segments = await this.format.ReadAsync(path, NullLogger.Instance, CancellationToken.None);
return new SegmentResults(segments
.Where(segment => segment.HasWords)
.DistinctBy(segment => segment.Key)