Test: Fix flaky DocumentTests by using arrays
All checks were successful
Test / Run tests (push) Successful in 1m46s

This commit is contained in:
2024-06-20 22:40:33 +02:00
parent 1121c18dc5
commit 750ae53428
4 changed files with 54 additions and 43 deletions

View File

@ -1,5 +1,6 @@
using Elwig.Documents;
using NReco.PdfRenderer;
using System.Text.RegularExpressions;
namespace Tests.DocumentTests {
public static class Utils {
@ -16,5 +17,13 @@ namespace Tests.DocumentTests {
File.Delete(FileName);
}
}
public static string[][] ExtractTable(string text) {
return text.Split('\n')
.Select(row => Regex.Split(row, @"\s{2,}").Select(c => c.Trim()).ToArray())
.Where(row => row.Length > 3)
.Skip(1)
.ToArray();
}
}
}