commit 6064ff78e7cfbacbaedfd22565e096e1bb604a29
parent c8f72c9f77dd3ce1bf25837d2729fc78d57d9cfd
Author: Andrew Laack <andrew@laack.co>
Date: Tue, 29 Sep 2026 14:17:25 -0500
Basic puppet test start
Diffstat:
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -24,6 +24,11 @@ fetch-test:
./test2.out
rm test2.out
+puppet-test:
+ ${TCOMMAND_P} tests/puppet-test.cpp ${TCOMMAND_S} -o test6.out
+ ./test6.out
+ rm test6.out
+
pure-test:
${TCOMMAND_P} tests/pure-test.cpp ${TCOMMAND_S} -o test3.out
./test3.out
@@ -40,7 +45,7 @@ crash-test:
./test5.out
rm test5.out
-test: pure-test browser-test fetch-test
+test: pure-test browser-test fetch-test puppet-test
lcov --capture --directory . --output-file coverage.info \
--no-external \
--rc geninfo_unexecuted_blocks=1 \
diff --git a/tests/puppet-test.cpp b/tests/puppet-test.cpp
@@ -0,0 +1,35 @@
+#include <catch2/catch_test_macros.hpp>
+#include "../include/utils.hpp"
+#include "../include/render.hpp"
+#include <filesystem>
+#include <ncurses.h>
+
+#include "../include/gemini-client.hpp"
+#include "../include/link.hpp"
+
+// Puppet entire browser
+
+TEST_CASE("q quits session immediately") {
+ Browser b {};
+ DrawState ds {};
+ REQUIRE_FALSE(mainLoop(ds, b, 'q'));
+}
+
+TEST_CASE("RESIZE falls through and returns") {
+ Browser b {};
+ DrawState ds {};
+ REQUIRE(mainLoop(ds, b, KEY_RESIZE));
+}
+
+
+
+//TEST_CASE("Puppet browser can traverse to a public site") {
+// Browser b {};
+// DrawState ds {};
+// std::string st = "olaack.co\n";
+//
+// for(auto& ch : st) {
+// mainLoop(ds, b, ch);
+// }
+// REQUIRE(b.getCurrentLink()->getLinkDestination().to_string() == "gemini://laack.co");
+//}