From: Martin Hostettler <textshell@uchuujin.de>
Date: Tue, 4 Nov 2025 21:57:27 +0100
Subject: tests: document_find.cpp: Don't include Tui/Utils_p.h

Use a local copy of size2int.

This should make "as-installed" tests work again.

Origin: upstream, https://github.com/tuiwidgets/tuiwidgets/commit/31ccc7af4ff47ec209e8e7b3508988fec5d2e2e9
---
 src/tests/document/document_find.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/tests/document/document_find.cpp b/src/tests/document/document_find.cpp
index dd7486c..905f7dd 100644
--- a/src/tests/document/document_find.cpp
+++ b/src/tests/document/document_find.cpp
@@ -13,7 +13,20 @@
 #include "../eventrecorder.h"
 #include "../Testhelper.h"
 
-#include <Tui/Utils_p.h>
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    static int size2int(qsizetype input) {
+        if (input < std::numeric_limits<int>::min() || input > std::numeric_limits<int>::max()) {
+            qFatal("Out of range size does not fit into int");
+            abort();
+        }
+        return static_cast<int>(input);
+    }
+#else
+    static int size2int(int input) {
+        return input;
+    }
+#endif
 
 
 namespace {
