vendor: import KillerPDF 1.7.5 source (GPL-3.0) as the base for MMD PDF

This commit is contained in:
2026-08-27 06:58:22 +02:00
commit 532485a830
577 changed files with 149058 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
using KillerPDF.Services;
using Xunit;
namespace KillerPDF.Tests
{
public class SearchServiceTests
{
private readonly SearchService _svc = new();
[Fact]
public void Search_EmptyQuery_ReturnsEmpty()
{
var result = _svc.Search("irrelevant.pdf", "");
Assert.Empty(result.ResultPages);
Assert.Equal(0, result.TotalHits);
}
[Fact]
public void Search_WhitespaceQuery_ReturnsEmpty()
{
var result = _svc.Search("irrelevant.pdf", " ");
Assert.Empty(result.ResultPages);
Assert.Equal(0, result.TotalHits);
}
[Fact]
public void Search_EmptyFilePath_ReturnsEmpty()
{
var result = _svc.Search("", "hello");
Assert.Empty(result.ResultPages);
Assert.Equal(0, result.TotalHits);
}
[Fact]
public void Search_MissingFile_ReturnsEmpty()
{
// Should not throw; non-existent file produces no results.
var result = _svc.Search(@"C:\does\not\exist.pdf", "hello");
Assert.Empty(result.ResultPages);
Assert.Equal(0, result.TotalHits);
}
[Fact]
public void SearchResult_PageRects_EmptyByDefault()
{
var result = new SearchResult();
Assert.Empty(result.PageRects);
Assert.Empty(result.ResultPages);
Assert.Equal(0, result.TotalHits);
}
}
}